diff --git a/roaring/roaring.go b/roaring/roaring.go index 496c51622..1ddc5f798 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -5518,7 +5518,6 @@ func (b *Bitmap) DifferenceInPlace(others ...*Bitmap) { } else { break } - } if targetKey == iKey { diff --git a/row_test.go b/row_test.go index 5680b8870..a4740c897 100644 --- a/row_test.go +++ b/row_test.go @@ -166,7 +166,6 @@ func eq(a, b []uint64) bool { func TestRow_DifferenceInPlace2(t *testing.T) { lucky := []uint64{1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99, 105, 111, 115, 127, 129, 133, 135, 141, 151, 159, 163, 169, 171, 189, 193, 195, 201, 205, 211, 219, 223, 231, 235, 237, 241, 259, 261, 267, 273, 283, 285, 289, 297} src := pilosa.NewRow(lucky...) - fmt.Println(src.Columns()) row1 := pilosa.NewRow() m := uint64(9) for i := m; i <= lucky[len(lucky)-1]; i += m { @@ -190,10 +189,10 @@ func TestRow_DifferenceInPlace2(t *testing.T) { res5 := src.Difference(row1, row2, row3, row4) res6 := src.Difference(row4, row3, row2, row1) res7 := src.Difference(row4).Difference(row3).Difference(row2).Difference(row1) - if eq(res5.Columns(), res6.Columns()) { - t.Fatal("should match") + if !eq(res5.Columns(), res6.Columns()) { + t.Fatalf("results do not match: %v, %v", res5.Columns(), res6.Columns()) } - if eq(res6.Columns(), res7.Columns()) { - t.Fatal("should match") + if !eq(res6.Columns(), res7.Columns()) { + t.Fatalf("results do not match: %v, %v", res6.Columns(), res7.Columns()) } }