Skip to content

Commit

Permalink
avoid unnecessary growing
Browse files Browse the repository at this point in the history
  • Loading branch information
semihbkgr committed Feb 13, 2023
1 parent a74c398 commit fed1f1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ func (m *Map[K, V]) removeItemFromIndex(item *element[K, V]) {

if data == m.metadata.Load() { // check that no resize happened
m.numItems.Add(^uintptr(0)) // decrement counter
if next == nil {
data.count.Add(^uintptr(0))
}
return
}
}
Expand Down

0 comments on commit fed1f1d

Please sign in to comment.