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

Method checkKeysSorted

roaring64/roaringarray64.go:420–434  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

418}
419
420func (ra *roaringArray64) checkKeysSorted() bool {
421 if len(ra.keys) == 0 || len(ra.keys) == 1 {
422 return true
423 }
424 previous := ra.keys[0]
425 for nextIdx := 1; nextIdx < len(ra.keys); nextIdx++ {
426 next := ra.keys[nextIdx]
427 if previous >= next {
428 return false
429 }
430 previous = next
431
432 }
433 return true
434}
435
436// validate checks the referential integrity
437// ensures len(keys) == len(containers), recurses and checks each container type

Callers 2

validateMethod · 0.95

Calls

no outgoing calls

Tested by 1