MCPcopy Create free account
hub / github.com/cockroachdb/swiss / normalizeCapacity

Function normalizeCapacity

map.go:315–317  ·  view source on GitHub ↗

normalizeCapacity rounds capacity to the next power of 2.

(capacity uint32)

Source from the content-addressed store, hash-verified

313
314// normalizeCapacity rounds capacity to the next power of 2.
315func normalizeCapacity(capacity uint32) uint32 {
316 return uint32(1) << min(bits.Len32(capacity-1), 31)
317}
318
319// New constructs a new Map with the specified initial capacity. If
320// initialCapacity is 0 the map will start out with zero capacity and will

Callers 1

InitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…