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

Method appendCopy

roaringarray.go:156–168  ·  view source on GitHub ↗
(sa roaringArray, startingindex int)

Source from the content-addressed store, hash-verified

154}
155
156func (ra *roaringArray) appendCopy(sa roaringArray, startingindex int) {
157 // cow only if the two request it, or if we already have a lightweight copy
158 copyonwrite := (ra.copyOnWrite && sa.copyOnWrite) || sa.needsCopyOnWrite(startingindex)
159 if !copyonwrite {
160 // since there is no copy-on-write, we need to clone the container (this is important)
161 ra.appendContainer(sa.keys[startingindex], sa.containers[startingindex].clone(), copyonwrite)
162 } else {
163 ra.appendContainer(sa.keys[startingindex], sa.containers[startingindex], copyonwrite)
164 if !sa.needsCopyOnWrite(startingindex) {
165 sa.setNeedsCopyOnWrite(startingindex)
166 }
167 }
168}
169
170func (ra *roaringArray) appendWithoutCopyMany(sa roaringArray, startingindex, end int) {
171 for i := startingindex; i < end; i++ {

Callers 7

appendCopyManyMethod · 0.95
OrFunction · 0.45
XorFunction · 0.45
AndNotFunction · 0.45
lazyORFunction · 0.45
lazyOrOnRangeFunction · 0.45
lazyIOrOnRangeFunction · 0.45

Calls 4

appendContainerMethod · 0.95
cloneMethod · 0.65
needsCopyOnWriteMethod · 0.45
setNeedsCopyOnWriteMethod · 0.45

Tested by

no test coverage detected