argminLoad returns the least-loaded shard index, tie-break lowest index.
(load []int)
| 173 | |
| 174 | // argminLoad returns the least-loaded shard index, tie-break lowest index. |
| 175 | func argminLoad(load []int) int { |
| 176 | idx := 0 |
| 177 | for i, l := range load { |
| 178 | if l < load[idx] { |
| 179 | idx = i |
| 180 | } |
| 181 | } |
| 182 | return idx |
| 183 | } |
| 184 | |
| 185 | // argmaxLoad returns the most-loaded shard index, tie-break lowest index. |
| 186 | func argmaxLoad(load []int) int { |
no outgoing calls
no test coverage detected