From 61109729fada2c26bd713a1f105702c03da3d2b7 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 20 Nov 2018 16:57:24 +0000 Subject: [PATCH] eet dict - remove redundant check of len, str and possibly strcmp aim for small speedups. --- src/lib/eet/eet_dictionary.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lib/eet/eet_dictionary.c b/src/lib/eet/eet_dictionary.c index c8ea01642b..acff624f1c 100644 --- a/src/lib/eet/eet_dictionary.c +++ b/src/lib/eet/eet_dictionary.c @@ -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);