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