]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: hash_new(): always use a step size of at least 4
authorMartin Wilck <mwilck@suse.com>
Thu, 21 Nov 2024 23:02:26 +0000 (00:02 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 29 Nov 2024 15:15:21 +0000 (09:15 -0600)
commit62eaff4a16dd459a9fd60c3002738d7d06417eee
tree6907b38db2f707b2cf9e5f8e7bc8a077f0b777f7
parent5f154ec21e0081daf8a02e3b6b1bf3836bb05801
libkmod: hash_new(): always use a step size of at least 4

The current algorithm would choose a step size of 4 for
n_buckets == 31, but 1 for n_buckets == 32, which seems wrong.
Fix it.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/257
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
shared/hash.c