summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2020-07-07 11:20:53 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-07 11:24:59 +0100
commit704d58d658ed4424a886c127f3bbe83afde1f2a1 (patch)
tree1b5e53952458b19590c44640e698939c1937e12d
parentcac95313c7fd6aad71d48f49efe26d974b0bd5bc (diff)
edje: Avoid string duplication when possible.
Summary: Most use case the part name dosen't contain the recursive name so we don't have to go through expensive eina_string_split operation. Reviewers: smohanty, cedric, Hermet, raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12045
-rw-r--r--src/lib/edje/edje_util.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 4d9a9dc369..33d00488e5 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5602,17 +5602,23 @@ _edje_real_part_text_text_source_description_get(Edje_Real_Part *ep, Edje_Real_P
5602Edje_Real_Part * 5602Edje_Real_Part *
5603_edje_real_part_recursive_get(Edje **ed, const char *part) 5603_edje_real_part_recursive_get(Edje **ed, const char *part)
5604{ 5604{
5605 Edje_Real_Part *rp; 5605 if ((*ed)->collection && (*ed)->collection->alias)
5606 char **path; 5606 {
5607 Edje_Real_Part *rp;
5608 char **path;
5607 5609
5608 path = eina_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0); 5610 path = eina_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0);
5609 if (!path) return NULL; 5611 if (!path) return NULL;
5610 5612
5611 rp = _edje_real_part_recursive_get_helper(ed, path); 5613 rp = _edje_real_part_recursive_get_helper(ed, path);
5614
5615 free(*path);
5616 free(path);
5617
5618 return rp;
5619 }
5612 5620
5613 free(*path); 5621 return _edje_real_part_get(*ed, part);;
5614 free(path);
5615 return rp;
5616} 5622}
5617 5623
5618Evas_Object * 5624Evas_Object *