From 3a8320e42de52997dd0fd8d44e001021f86548b6 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 24 May 2016 12:03:13 +0900 Subject: [PATCH] edc_parser: code refactoring. factorize depth. --- src/lib/edc_parser.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/lib/edc_parser.c b/src/lib/edc_parser.c index 7df6088..7a4a9e2 100644 --- a/src/lib/edc_parser.c +++ b/src/lib/edc_parser.c @@ -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; - } - } } }