lib/hashtable: remove superfluous check
PATCH 1/1 lib/hashtable: remove superfluous check
We assign first_deleted = 0. There is no need to check its value without any further assignment in between.
Signed-off-by Heinrich Schuchardt <[email protected]>
---
indicated by cppcheck
--- lib/hashtable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/hashtable.c +1 -2
@@ -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,
--
2.28.0
PATCH 1/1 lib/hashtable: remove superfluous check
Quoted 10 lines · Heinrich Schuchardt
We assign
first_deleted= 0. There is no need to check its value without any further assignment in between.Signed-off-by Heinrich Schuchardt <[email protected]>---
indicated by cppcheck--- lib/hashtable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by Simon Glass <[email protected]>
PATCH 1/1 lib/hashtable: remove superfluous check
In reply to Heinrich SchuchardtQuoted 5 lines · Heinrich Schuchardt
We assign
first_deleted= 0. There is no need to check its value without any further assignment in between.Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201013/a4aa2b1c/attachment.sig>