fix: drop() decrements bucket size

This commit is contained in:
2026-03-19 20:01:14 -04:00
parent d4acdda95b
commit 74ed81761c

View File

@@ -26,11 +26,12 @@ func (b bucket[K, V]) get(key K) (value V, found bool) {
return slot.value, slot.occupied && b.compare(slot.key, key)
}
func (b bucket[K, V]) drop(key K) (occupied bool) {
func (b *bucket[K, V]) drop(key K) (occupied bool) {
slot := &b.slots[b.location(key)]
if slot.occupied && b.compare(slot.key, key) {
slot.occupied = false
b.size--
return true
}