mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-10-03 23:38:25 +00:00
hashmap: Invalid operator was used when applying a mask
Logical OR instead of a binary AND was used. Because of that all elements were placed on the first position of the hashmap, making it a really long list instead of a real hashmap. Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ size_t hashmap_hash_from_string(const char *key)
|
||||
|
||||
static inline struct list **get_hashmap_list(struct hashmap *hashmap, const void *data)
|
||||
{
|
||||
return &hashmap->map[hashmap->hash(data) || HASH_MASK(hashmap->mask_bits)];
|
||||
return &hashmap->map[hashmap->hash(data) & HASH_MASK(hashmap->mask_bits)];
|
||||
}
|
||||
|
||||
static unsigned int calc_bits(size_t capacity)
|
||||
|
||||
Reference in New Issue
Block a user