(sa roaringArray, startingindex int)
| 154 | } |
| 155 | |
| 156 | func (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 | |
| 170 | func (ra *roaringArray) appendWithoutCopyMany(sa roaringArray, startingindex, end int) { |
| 171 | for i := startingindex; i < end; i++ { |
no test coverage detected