MCPcopy
hub / github.com/cornelk/hashmap / isResizeNeeded

Method isResizeNeeded

hashmap.go:239–243  ·  view source on GitHub ↗
(store *store[Key, Value], count uintptr)

Source from the content-addressed store, hash-verified

237}
238
239func (m *Map[Key, Value]) isResizeNeeded(store *store[Key, Value], count uintptr) bool {
240 l := uintptr(len(store.index)) // l can't be 0 as it gets initialized in New()
241 fillRate := (count * 100) / l
242 return fillRate > maxFillRate
243}
244
245func (m *Map[Key, Value]) insertElement(element *ListElement[Key, Value], hash uintptr, key Key, value Value) bool {
246 var existed, inserted bool

Callers 4

InsertMethod · 0.95
SetMethod · 0.95
insertElementMethod · 0.95
growMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected