]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
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 4a8c50b4b8ac9835d63e6bb680ce8bfa827d59b7..7c08f5c8055151b9c57577b8e273cbc4a9ddc239 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,