From 56ba127210efa0ee4a4e52b5eed368c5c3ffdb0f Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Tue, 30 May 2017 16:09:02 -0500 Subject: [PATCH] set n based on array length instead of incrementing repeatedly --- roaring/roaring.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roaring/roaring.go b/roaring/roaring.go index d88447206..61f2f2873 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -1313,10 +1313,10 @@ func intersectArrayArray(a, b *container) *container { j++ } else { output.array = append(output.array, va) - output.n++ i, j = i+1, j+1 } } + output.n = len(output.array) return output }