MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / getIndex

Method getIndex

roaring64/roaringarray64.go:218–225  ·  view source on GitHub ↗
(x uint32)

Source from the content-addressed store, hash-verified

216}
217
218func (ra *roaringArray64) getIndex(x uint32) int {
219 // before the binary search, we optimize for frequent cases
220 size := len(ra.keys)
221 if (size == 0) || (ra.keys[size-1] == x) {
222 return size - 1
223 }
224 return ra.binarySearch(0, int64(size), x)
225}
226
227func (ra *roaringArray64) getKeyAtIndex(i int) uint32 {
228 return ra.keys[i]

Callers 9

appendCopiesAfterMethod · 0.45
AddMethod · 0.45
CheckedAddMethod · 0.45
RemoveMethod · 0.45
CheckedRemoveMethod · 0.45
getOrCreateContainerMethod · 0.45
FlipMethod · 0.45
RemoveRangeMethod · 0.45
FlipFunction · 0.45

Calls 1

binarySearchMethod · 0.95

Tested by

no test coverage detected