Skip to content

Commit 048f20d

Browse files
move indexing into branch
1 parent a5633ea commit 048f20d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Data/HashMap/Internal.hs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1859,10 +1859,13 @@ intersectionArrayBy f !b1 !b2 !ary1 !ary2
18591859
testBit x = x .&. m /= 0
18601860
b' = b .&. complement m
18611861
(len, bFinal) <- go 0 0 0 bCombined bIntersect
1862-
l <- A.read mary 0
18631862
case len of
18641863
0 -> pure Empty
1865-
1 | isLeafOrCollision l -> pure l
1864+
1 -> do
1865+
l <- A.read mary 0
1866+
if isLeafOrCollision l
1867+
then pure l
1868+
else BitmapIndexed bFinal <$> (A.unsafeFreeze =<< A.shrink mary len)
18661869
_ -> bitmapIndexedOrFull bFinal <$> (A.unsafeFreeze =<< A.shrink mary len)
18671870
where
18681871
bCombined = b1 .|. b2

0 commit comments

Comments
 (0)