MCPcopy Create free account
hub / github.com/benbjohnson/immutable / get

Method get

immutable.go:905–911  ·  view source on GitHub ↗

get returns the value for the given key.

(key K, shift uint, keyHash uint32, h Hasher[K])

Source from the content-addressed store, hash-verified

903
904// get returns the value for the given key.
905func (n *mapArrayNode[K, V]) get(key K, shift uint, keyHash uint32, h Hasher[K]) (value V, ok bool) {
906 i := n.indexOf(key, h)
907 if i == -1 {
908 return value, false
909 }
910 return n.entries[i].value, true
911}
912
913// set inserts or updates the value for a given key. If the key is inserted and
914// the new size crosses the max size threshold, a bitmap indexed node is returned.

Callers

nothing calls this directly

Calls 4

indexOfMethod · 0.95
getMethod · 0.65
EqualMethod · 0.65
CompareMethod · 0.65

Tested by

no test coverage detected