path: root/src/lib
diff options
authorsubhransu mohanty <>2019-08-09 14:02:24 +0900
committerHermet Park <>2019-08-09 14:02:24 +0900
commit1b94d90d53dd71457cd92575d9f29c58d76eef75 (patch)
tree4940000d4b99f4d312d077439b39be36d6b178b9 /src/lib
parentda39f53b95c9bae298fb0145f152c2d81b5ebe31 (diff)
edje: optimize color_class_recursive_find_helper() function
Summary: If the color_class is not overridden by the object level the hash will be empty but still we do the expensive call to _edje_hash_find_helper() find the color_class in an empty hash. by checking if the hash is empty and returning early we save lot of unnecessary hash computaion and lookup. Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
Diffstat (limited to 'src/lib')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 20aeec4a53..4e3cdba15d 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5722,6 +5722,8 @@ _edje_color_class_recursive_find_helper(const Edje *ed, Eina_Hash *hash, const c
5722 Edje_Color_Tree_Node *ctn = NULL; 5722 Edje_Color_Tree_Node *ctn = NULL;
5723 const char *parent; 5723 const char *parent;
5724 5724
5725 if (!eina_hash_population(hash)) return NULL;
5725 cc = _edje_hash_find_helper(hash, color_class); 5727 cc = _edje_hash_find_helper(hash, color_class);
5726 if (cc) return cc; 5728 if (cc) return cc;
5727 else if (ed->file) 5729 else if (ed->file)