indexOf returns the entry index of the given key. Returns -1 if key not found.
(key K, h Hasher[K])
| 893 | |
| 894 | // indexOf returns the entry index of the given key. Returns -1 if key not found. |
| 895 | func (n *mapArrayNode[K, V]) indexOf(key K, h Hasher[K]) int { |
| 896 | for i := range n.entries { |
| 897 | if h.Equal(n.entries[i].key, key) { |
| 898 | return i |
| 899 | } |
| 900 | } |
| 901 | return -1 |
| 902 | } |
| 903 | |
| 904 | // get returns the value for the given key. |
| 905 | func (n *mapArrayNode[K, V]) get(key K, shift uint, keyHash uint32, h Hasher[K]) (value V, ok bool) { |