getZones return the list zones from the provided tokens. The returned list is guaranteed to be sorted.
(tokens map[string][]uint32)
| 129 | // getZones return the list zones from the provided tokens. The returned list |
| 130 | // is guaranteed to be sorted. |
| 131 | func getZones(tokens map[string][]uint32) []string { |
| 132 | var zones []string |
| 133 | |
| 134 | for zone := range tokens { |
| 135 | zones = append(zones, zone) |
| 136 | } |
| 137 | |
| 138 | sort.Strings(zones) |
| 139 | return zones |
| 140 | } |
| 141 | |
| 142 | // searchToken returns the offset of the tokens entry holding the range for the provided key. |
| 143 | func searchToken(tokens []uint32, key uint32) int { |
no outgoing calls