more refactoring and micro optimizations

This commit is contained in:
Richard Artoul 2018-11-29 17:29:32 -05:00
parent ddfc95070b
commit 12d45415bb

View file

@ -659,8 +659,9 @@ func (b *Bitmap) unionIntoTarget(target *Bitmap, others ...*Bitmap) {
// Once we've acquired a bitmap container (either by reusing the existing one
// or allocating a new one) then the last step is to iterate through all the
// other containers to see which ones have the same key, and union all of them
// into the target bitmap container.
for j, jIter := range bitmapIters {
// into the target bitmap container. Only need to loop starting from i because
// anything previous to that has already been handled.
for j, jIter := range bitmapIters[i:] {
jKey, jContainer := jIter.iter.Value()
if iKey == jKey {