summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-11-13 14:25:10 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-11-13 14:25:10 -0800
commit6bbcb3cc15297dcd543fefa8789ec6c302edefbf (patch)
tree80fc9720c6d042369e28614affbd287c5f2fe316 /src
parenteddd52cba7ee8448e9b05d97d014f268d059e887 (diff)
edje: last improvement of _edje_hash_find_helper speed by reducing call to eina split function.
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index e37a8d43f7..03f38abfcc 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5354,6 +5354,15 @@ _edje_hash_find_helper(const Eina_Hash *hash, const char *key)
5354 if (remember_key == key) 5354 if (remember_key == key)
5355 return NULL; 5355 return NULL;
5356 5356
5357 // It is usually faster to walk the string once to check
5358 // if there will be any tokens to process, that to allocate
5359 // an array, copy one token, and then just free it.
5360 if (strchr(key, '/') == NULL)
5361 {
5362 remember_key = key;
5363 return NULL;
5364 }
5365
5357 tokens = eina_str_split_full(key, "/", 0, &tokens_count); 5366 tokens = eina_str_split_full(key, "/", 0, &tokens_count);
5358 if ((tokens) && (tokens_count > 1)) 5367 if ((tokens) && (tokens_count > 1))
5359 { 5368 {