edc_parser: code refactoring.

factorize depth.
This commit is contained in:
Hermet Park 2016-05-24 12:03:13 +09:00
parent cc538a8508
commit 3a8320e42d
1 changed files with 5 additions and 11 deletions

View File

@ -1553,19 +1553,13 @@ parser_attribute_get(parser_data *pd, const char *text, const char *cur,
EINA_INARRAY_FOREACH(pd->attrs, attr)
{
if (!strcmp(selected, attr->keyword))
if (strcmp(selected, attr->keyword)) continue;
if (!attr->context) return &attr->value;
if (!cur_context) continue;
for (i = 0; i < name_count; i++)
{
if (!attr->context)
if (!strcmp(cur_context[i], attr->context))
return &attr->value;
if (cur_context)
{
for (i = 0; i < name_count; i++)
{
if (!strcmp(cur_context[i], attr->context))
return &attr->value;
}
}
}
}