forked from enlightenment/efl
datetime: Simplify the nested loop in _datetime_items_get()
This commit is contained in:
parent
36ea4dea78
commit
db892d4ba3
|
@ -389,26 +389,22 @@ _datetime_items_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eina_List *items = NULL;
|
Eina_List *items = NULL;
|
||||||
Datetime_Field *field;
|
Datetime_Field *field;
|
||||||
int loc = 0;
|
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
Eina_Bool visible[ELM_DATETIME_TYPE_COUNT];
|
Datetime_Field *sorted_fields[ELM_DATETIME_TYPE_COUNT];
|
||||||
|
|
||||||
ELM_DATETIME_DATA_GET(obj, sd);
|
ELM_DATETIME_DATA_GET(obj, sd);
|
||||||
|
|
||||||
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
|
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
|
||||||
{
|
{
|
||||||
field = sd->field_list + idx;
|
field = sd->field_list + idx;
|
||||||
if (field->fmt_exist && field->visible) visible[idx] = EINA_TRUE;
|
sorted_fields[field->location] = field;
|
||||||
else visible[idx] = EINA_FALSE;
|
|
||||||
}
|
}
|
||||||
for (loc = 0; loc < ELM_DATETIME_TYPE_COUNT; loc++)
|
|
||||||
|
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
|
||||||
{
|
{
|
||||||
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
|
field = sorted_fields + idx;
|
||||||
{
|
if (field->fmt_exist && field->visible)
|
||||||
field = sd->field_list + idx;
|
items = eina_list_append(items, field->item_obj);
|
||||||
if ((field->location == loc) && (visible[idx]))
|
|
||||||
items = eina_list_append(items, field->item_obj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ACCESS
|
// ACCESS
|
||||||
|
|
Loading…
Reference in New Issue