summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2020-07-16 11:37:10 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-16 11:37:10 +0100
commit8941514b467ce3e5d02c9b936d35a9d393989260 (patch)
tree39fa9d2c6040219f0f142c3eb9d5d7371fb41ea7
parent8504f213d68ffeba830ff8a1bec8ec93bfa85e3c (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. Test Plan: edje-suite (34/37 edje-suite OK 0.67 s) elementary-test app launching on enlightenment Reviewers: raster, smohanty, Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12055
-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..f0102cd68c 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 (strchr(part, EDJE_PART_PATH_SEPARATOR))
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 *