diff options
Diffstat (limited to 'src/wayland-hash.c')
| -rw-r--r-- | src/wayland-hash.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/wayland-hash.c b/src/wayland-hash.c index 1ec6be4..01ccd7c 100644 --- a/src/wayland-hash.c +++ b/src/wayland-hash.c @@ -176,9 +176,7 @@ hash_table_search(struct wl_hash_table *ht, uint32_t hash) return entry; } - double_hash = hash % ht->rehash; - if (double_hash == 0) - double_hash = 1; + double_hash = 1 + hash % ht->rehash; hash_address = (hash_address + double_hash) % ht->size; } while (hash_address != hash % ht->size); @@ -277,9 +275,7 @@ wl_hash_table_insert(struct wl_hash_table *ht, uint32_t hash, void *data) return 0; } - double_hash = hash % ht->rehash; - if (double_hash == 0) - double_hash = 1; + double_hash = 1 + hash % ht->rehash; hash_address = (hash_address + double_hash) % ht->size; } while (hash_address != hash % ht->size); |
