From ea438884efb7277bfe36d8cda62ebf9815539161 Mon Sep 17 00:00:00 2001 From: triallax Date: Thu, 30 May 2024 15:14:57 +0100 Subject: [PATCH] libvisual: fix accidental assignment instead of equality check with the accidental assignment, the function would always return 0 for a keytype of VISUAL_HASHMAP_KEY_TYPE_STRING (because it has a value of 2), which is technically valid but not good for obvious reasons --- libvisual/libvisual/lv_hashmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvisual/libvisual/lv_hashmap.c b/libvisual/libvisual/lv_hashmap.c index 3a42b7733..0dffa47cc 100644 --- a/libvisual/libvisual/lv_hashmap.c +++ b/libvisual/libvisual/lv_hashmap.c @@ -261,7 +261,7 @@ static int get_hash (VisHashmap *hashmap, void *key, VisHashmapKeyType keytype) { if (keytype == VISUAL_HASHMAP_KEY_TYPE_INTEGER) return integer_hash (*((uint32_t *) key)) % hashmap->tablesize; - else if (keytype = VISUAL_HASHMAP_KEY_TYPE_STRING) + else if (keytype == VISUAL_HASHMAP_KEY_TYPE_STRING) return string_hash ((char *) key) % hashmap->tablesize; return 0;