From f3c164c483389cb967b0ec77bbf01e37c40f429a Mon Sep 17 00:00:00 2001 From: Seebs Date: Tue, 23 Aug 2022 14:19:01 -0500 Subject: [PATCH] don't rerun comparison pointlessly The comment says "convert to each type and compare", but it doesn't convert, it just compares the given container result to three different forms of the same result. That's neat for testing BitwiseEqual but doesn't actually give us more information, and it takes nearly 3x as long. --- roaring/roaring_internal_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roaring/roaring_internal_test.go b/roaring/roaring_internal_test.go index 860346a47..044ebb4d3 100644 --- a/roaring/roaring_internal_test.go +++ b/roaring/roaring_internal_test.go @@ -3766,11 +3766,11 @@ func TestContainerCombinations(t *testing.T) { ret := runContainerFunc(testOp.f, cts[x][testOp.x], cts[y][testOp.y]) exp := testOp.exp - // Convert to all container types and check result. - for _, ct := range containerTypes { - if err := ret.BitwiseCompare(cts[ct][exp]); err != nil { - t.Error(err) - } + // Compare to the same-type container, which is usually the cheapest + // to compare with. + ct := ret.typ() + if err := ret.BitwiseCompare(cts[ct][exp]); err != nil { + t.Error(err) } }) }