@@ -267,6 +267,7 @@ instance (Show k, Show v) => Show (HashMap k v) where
267
267
268
268
instance Traversable (HashMap k ) where
269
269
traverse f = traverseWithKey (const f)
270
+ {-# INLINABLE traverse #-}
270
271
271
272
#if MIN_VERSION_base(4,9,0)
272
273
instance Eq2 HashMap where
@@ -1387,7 +1388,9 @@ unionArrayBy f b1 b2 ary1 ary2 = A.run $ do
1387
1388
| m > b' = return ()
1388
1389
| b' .&. m == 0 = go i i1 i2 (m `unsafeShiftL` 1 )
1389
1390
| ba .&. m /= 0 = do
1390
- A. write mary i $! f (A. index ary1 i1) (A. index ary2 i2)
1391
+ x1 <- A. indexM ary1 i1
1392
+ x2 <- A. indexM ary2 i2
1393
+ A. write mary i $! f x1 x2
1391
1394
go (i+ 1 ) (i1+ 1 ) (i2+ 1 ) (m `unsafeShiftL` 1 )
1392
1395
| b1 .&. m /= 0 = do
1393
1396
A. write mary i =<< A. indexM ary1 i1
@@ -1657,7 +1660,7 @@ filterMapAux onLeaf onColl = go
1657
1660
return $! Collision h ary2
1658
1661
| otherwise -> do ary2 <- A. trim mary j
1659
1662
return $! Collision h ary2
1660
- | Just el <- onColl ( A. index ary i)
1663
+ | Just el <- onColl $! A. index ary i
1661
1664
= A. write mary j el >> step ary mary (i+ 1 ) (j+ 1 ) n
1662
1665
| otherwise = step ary mary (i+ 1 ) j n
1663
1666
{-# INLINE filterMapAux #-}
@@ -1830,7 +1833,9 @@ update16M ary idx b = do
1830
1833
1831
1834
-- | /O(n)/ Update the element at the given position in this array, by applying a function to it.
1832
1835
update16With' :: A. Array e -> Int -> (e -> e ) -> A. Array e
1833
- update16With' ary idx f = update16 ary idx $! f (A. index ary idx)
1836
+ update16With' ary idx f
1837
+ | (# x # ) <- A. index# ary idx
1838
+ = update16 ary idx $! f x
1834
1839
{-# INLINE update16With' #-}
1835
1840
1836
1841
-- | Unsafely clone an array of 16 elements. The length of the input
0 commit comments