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

Method AsSlice

runcontainer.go:959–969  ·  view source on GitHub ↗

AsSlice decompresses the contents into a []uint16 slice.

()

Source from the content-addressed store, hash-verified

957
958// AsSlice decompresses the contents into a []uint16 slice.
959func (rc *runContainer16) AsSlice() []uint16 {
960 s := make([]uint16, rc.getCardinality())
961 j := 0
962 for _, p := range rc.iv {
963 for i := p.start; i <= p.last(); i++ {
964 s[j] = i
965 j++
966 }
967 }
968 return s
969}
970
971// newRunContainer16 creates an empty run container.
972func newRunContainer16() *runContainer16 {

Callers 1

TestRleRandomUnion16Function · 0.80

Calls 2

getCardinalityMethod · 0.95
lastMethod · 0.80

Tested by 1

TestRleRandomUnion16Function · 0.64