From 83da781e817e984498a6b30a0c9c3d77a648cade Mon Sep 17 00:00:00 2001 From: Andrew Athan Date: Sat, 3 Dec 2022 21:33:08 -0800 Subject: [PATCH] Fix possible bug in bucket.del() See comment --- hashmap/bucket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hashmap/bucket.go b/hashmap/bucket.go index 6ae0dd7..e27157d 100644 --- a/hashmap/bucket.go +++ b/hashmap/bucket.go @@ -88,7 +88,7 @@ func (b *bucket) del(node *hashNode) bool { if insert { return false } - curr.nxt = nil + //curr.nxt = nil -- not sure the purpose of this, but given that Next() is following the linked list, if an interrupt can occur between these lines, the iteration will stop curr.nxt = next.nxt atomic.AddUint32(&b.count, ^uint32(0)) return true