hmap_chained: fix for not properly being able to override slots with matching key (that were still occupied)
This commit is contained in:
parent
b54d336193
commit
1fb011f56c
@ -223,7 +223,7 @@ hmap_chained_set :: proc( self : HMapChained($Type), key : u64, value : Type ) -
|
||||
return & surface_slot.value, error
|
||||
}
|
||||
|
||||
if ! surface_slot.occupied
|
||||
if ! surface_slot.occupied || surface_slot.key == key
|
||||
{
|
||||
surface_slot.key = key
|
||||
surface_slot.value = value
|
||||
@ -257,7 +257,7 @@ hmap_chained_set :: proc( self : HMapChained($Type), key : u64, value : Type ) -
|
||||
}
|
||||
}
|
||||
|
||||
if ! slot.next.occupied
|
||||
if ! slot.next.occupied || surface_slot.key == key
|
||||
{
|
||||
slot.next.key = key
|
||||
slot.next.value = value
|
||||
|
Loading…
Reference in New Issue
Block a user