LookupString looks up the supplied string in the map
(s string)
| 128 | |
| 129 | // LookupString looks up the supplied string in the map |
| 130 | func (m *Uint32Store) LookupString(s string) (uint32, bool) { |
| 131 | bv := &m.store[0] |
| 132 | for i, n := 0, len(s); i < n; i++ { |
| 133 | b := s[i] |
| 134 | if b < bv.nextOffset { |
| 135 | return 0, false |
| 136 | } |
| 137 | ni := b - bv.nextOffset |
| 138 | if ni >= bv.nextLen { |
| 139 | return 0, false |
| 140 | } |
| 141 | bv = &m.store[bv.nextLo+uint32(ni)] |
| 142 | } |
| 143 | return bv.value, bv.valid |
| 144 | } |
| 145 | |
| 146 | // LookupBytes looks up the supplied byte slice in the map |
| 147 | func (m *Uint32Store) LookupBytes(s []byte) (uint32, bool) { |
no outgoing calls