(sa roaringArray64, startingindex int)
| 43 | } |
| 44 | |
| 45 | func (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 | |
| 59 | func (ra *roaringArray64) appendWithoutCopyMany(sa roaringArray64, startingindex, end int) { |
| 60 | for i := startingindex; i < end; i++ { |
no test coverage detected