lib/hashtable: remove superfluous check
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 20 Aug 2020 17:57:45 +0000 (19:57 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 13 Oct 2020 01:30:37 +0000 (21:30 -0400)
We assign first_deleted = 0. There is no need to check its value without
any further assignment in between.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/hashtable.c

index 4a8c50b..7c08f5c 100644 (file)
@@ -324,8 +324,7 @@ int hsearch_r(struct env_entry item, enum env_action action,
                 */
                unsigned hval2;
 
-               if (htab->table[idx].used == USED_DELETED
-                   && !first_deleted)
+               if (htab->table[idx].used == USED_DELETED)
                        first_deleted = idx;
 
                ret = _compare_and_overwrite_entry(item, action, retval, htab,