eet dict - remove redundant check of len, str and possibly strcmp
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 20 Nov 2018 16:57:24 +0000 (16:57 +0000)
committerHermet Park <hermetpark@gmail.com>
Wed, 5 Dec 2018 05:21:28 +0000 (14:21 +0900)
aim for small speedups.

src/lib/eet/eet_dictionary.c

index c8ea016..acff624 100644 (file)
@@ -101,16 +101,10 @@ eet_dictionary_string_add(Eet_Dictionary *ed,
    eina_rwlock_take_read(&ed->rwlock);
 
    idx = _eet_dictionary_lookup(ed, string, len, hash, &pidx);
-
    if (idx != -1)
      {
-        if (ed->all[idx].str && 
-            ((ed->all[idx].str == string) ||
-                (!strcmp(ed->all[idx].str, string))))
-         {
-             eina_rwlock_release(&ed->rwlock);
-           return idx;
-         }
+        eina_rwlock_release(&ed->rwlock);
+        return idx;
      }
 
    str = eina_stringshare_add(string);