Closed semihbkgr closed 1 year ago
Map is resizing unnecessarily after same operations although the map length is always same.
m := New[int, any]() fmt.Printf("len: %d, indexCount: %d\n", m.Len(), len(m.metadata.Load().index)) for i := 0; i < 10000; i++ { m.Set(i, nil) m.Del(i) } fmt.Printf("len: %d, indexCount: %d\n", m.Len(), len(m.metadata.Load().index))
the output:
len: 0, indexCount: 8 len: 0, indexCount: 16384
Map is resizing unnecessarily after same operations although the map length is always same.
the output: