MCPcopy
hub / github.com/RoaringBitmap/roaring / toArray

Method toArray

roaring.go:452–463  ·  view source on GitHub ↗
(array *[]uint32)

Source from the content-addressed store, hash-verified

450}
451
452func (rb *Bitmap) toArray(array *[]uint32) *[]uint32 {
453 pos := 0
454 pos2 := 0
455
456 for pos < rb.highlowcontainer.size() {
457 hs := uint32(rb.highlowcontainer.getKeyAtIndex(pos)) << 16
458 c := rb.highlowcontainer.getContainerAtIndex(pos)
459 pos++
460 pos2 = c.fillLeastSignificant16bits(*array, pos2, hs)
461 }
462 return array
463}
464
465// ToExistingArray stores all of the integers stored in the Bitmap in sorted order in the
466// slice that is given to ToExistingArray. It is the callers duty to make sure the slice

Callers 2

ToArrayMethod · 0.95
ToExistingArrayMethod · 0.95

Calls 4

sizeMethod · 0.45
getKeyAtIndexMethod · 0.45
getContainerAtIndexMethod · 0.45

Tested by

no test coverage detected