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

Method appendCopy

roaring64/roaringarray64.go:45–57  ·  view source on GitHub ↗
(sa roaringArray64, startingindex int)

Source from the content-addressed store, hash-verified

43}
44
45func (ra *roaringArray64) appendCopy(sa roaringArray64, startingindex int) {
46 // cow only if the two request it, or if we already have a lightweight copy
47 copyonwrite := (ra.copyOnWrite && sa.copyOnWrite) || sa.needsCopyOnWrite(startingindex)
48 if !copyonwrite {
49 // since there is no copy-on-write, we need to clone the container (this is important)
50 ra.appendContainer(sa.keys[startingindex], sa.containers[startingindex].Clone(), copyonwrite)
51 } else {
52 ra.appendContainer(sa.keys[startingindex], sa.containers[startingindex].Clone(), copyonwrite)
53 if !sa.needsCopyOnWrite(startingindex) {
54 sa.setNeedsCopyOnWrite(startingindex)
55 }
56 }
57}
58
59func (ra *roaringArray64) appendWithoutCopyMany(sa roaringArray64, startingindex, end int) {
60 for i := startingindex; i < end; i++ {

Callers 6

appendCopyManyMethod · 0.95
orOnRangeFunction · 0.95
OrFunction · 0.45
XorFunction · 0.45
AndNotFunction · 0.45
iorOnRangeFunction · 0.45

Calls 4

appendContainerMethod · 0.95
needsCopyOnWriteMethod · 0.45
CloneMethod · 0.45
setNeedsCopyOnWriteMethod · 0.45

Tested by

no test coverage detected