diff --git a/map.go b/map.go index c5cd5e2..e86b180 100644 --- a/map.go +++ b/map.go @@ -124,7 +124,10 @@ func NewMap() *Map { } // NewMapPresized creates a new Map instance with capacity enough to hold -// sizeHint entries. If sizeHint is zero or negative, the value is ignored. +// sizeHint entries. The capacity is treated as the minimal capacity +// meaning that the underlying hash table will never shrink to +// a smaller capacity. If sizeHint is zero or negative, the value +// is ignored. func NewMapPresized(sizeHint int) *Map { m := &Map{} m.resizeCond = *sync.NewCond(&m.resizeMu) diff --git a/mapof.go b/mapof.go index 4388662..ea767da 100644 --- a/mapof.go +++ b/mapof.go @@ -71,7 +71,9 @@ func NewMapOf[K comparable, V any]() *MapOf[K, V] { } // NewMapOfPresized creates a new MapOf instance with capacity enough -// to hold sizeHint entries. If sizeHint is zero or negative, the value +// to hold sizeHint entries. The capacity is treated as the minimal capacity +// meaning that the underlying hash table will never shrink to +// a smaller capacity. If sizeHint is zero or negative, the value // is ignored. func NewMapOfPresized[K comparable, V any](sizeHint int) *MapOf[K, V] { return newMapOfPresized[K, V](makeHasher[K](), sizeHint)