Skip to content

Commit ea43888

Browse files
triallaxhartwork
authored andcommitted
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
1 parent 222b6c4 commit ea43888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libvisual/libvisual/lv_hashmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static int get_hash (VisHashmap *hashmap, void *key, VisHashmapKeyType keytype)
261261
{
262262
if (keytype == VISUAL_HASHMAP_KEY_TYPE_INTEGER)
263263
return integer_hash (*((uint32_t *) key)) % hashmap->tablesize;
264-
else if (keytype = VISUAL_HASHMAP_KEY_TYPE_STRING)
264+
else if (keytype == VISUAL_HASHMAP_KEY_TYPE_STRING)
265265
return string_hash ((char *) key) % hashmap->tablesize;
266266

267267
return 0;

0 commit comments

Comments
 (0)