diff options
| author | Andrea Canciani <ranma42@gmail.com> | 2011-11-14 10:24:47 +0100 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-11-15 10:15:48 -0500 |
| commit | 3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c (patch) | |
| tree | 48bbb695557597835abb9c861b85e347af65a2bb /src/wayland-util.c | |
| parent | scanner: Check name == NULL for enum entries (diff) | |
| download | wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.tar wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.tar.gz wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.tar.bz2 wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.tar.lz wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.tar.xz wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.tar.zst wayland-3175e91efa4d4cb1847044f9ea4a8ef57fd6f39c.zip | |
hash: Improve double hashing
Instead of artificially introducing collisions in the step value by
replacing 0 with 1 (which causes the value 1 to have twice the
frequency of any other value), the step value can simply be computed
as an uniformly distributed value in the range [1, rehash], extremes
included.
This is safe because any step value smaller than the hash modulus is
co-prime with it, hence induces an orbit which includes every integer
in [0, size - 1].
Diffstat (limited to 'src/wayland-util.c')
0 files changed, 0 insertions, 0 deletions
