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

Method runOptimize

roaring64/roaringarray64.go:28–32  ·  view source on GitHub ↗

runOptimize compresses the element containers to minimize space consumed. Q: how does this interact with copyOnWrite and needCopyOnWrite? A: since we aren't changing the logical content, just the representation, we don't bother to check the needCopyOnWrite bits. We replace (possibly all) elements

()

Source from the content-addressed store, hash-verified

26// (possibly all) elements of ra.containers in-place with space
27// optimized versions.
28func (ra *roaringArray64) runOptimize() {
29 for i := range ra.containers {
30 ra.containers[i].RunOptimize()
31 }
32}
33
34func (ra *roaringArray64) appendContainer(key uint32, value *roaring.Bitmap, mustCopyOnWrite bool) {
35 ra.keys = append(ra.keys, key)

Callers 1

RunOptimizeMethod · 0.45

Calls 1

RunOptimizeMethod · 0.45

Tested by

no test coverage detected