Skip to content

Commit ecb222e

Browse files
committed
filter.go: Use strict patterns
1 parent 24c2522 commit ecb222e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Data/HashMap/Internal.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,9 +1893,6 @@ difference = go 0
18931893
-- TODO: This could be faster if we would keep track of which elements of ary2
18941894
-- we've already matched. Those could be skipped when we check the following
18951895
-- elements of ary1.
1896-
--
1897-
-- TODO: For some reason, ary2 is unboxed, but ary1 is not.
1898-
-- https://gitlab.haskell.org/ghc/ghc/-/issues/26525
18991896
differenceCollisions :: Eq k => Hash -> A.Array (Leaf k v1) -> HashMap k v1 -> Hash -> A.Array (Leaf k v2) -> HashMap k v1
19001897
differenceCollisions !h1 !ary1 t1 !h2 !ary2
19011898
| h1 == h2 =

Data/HashMap/Internal/Array.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ filter f = \ ary ->
507507
len <- go ary mary 0 0 n
508508
shrink mary len
509509
where
510-
go ary mary iAry iMary n
510+
-- Without the @!@ on @ary@ we end up reboxing the array when using
511+
-- 'differenceCollisions'. See
512+
-- https://gitlab.haskell.org/ghc/ghc/-/issues/26525.
513+
go !ary !mary !iAry !iMary !n
511514
| iAry >= n = return iMary
512515
| otherwise = do
513516
x <- indexM ary iAry

0 commit comments

Comments
 (0)