File tree 2 files changed +5
-0
lines changed
containers-tests/benchmarks
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ main = do
27
27
, bench " lookup present" $ whnf (lookup evens) m_even
28
28
, bench " map" $ whnf (M. map (+ 1 )) m
29
29
, bench " map really" $ nf (M. map (+ 2 )) m
30
+ , bench " filter" $ whnf (M. filter even ) m
31
+ , bench " filter really" $ nf (M. filter even ) m
30
32
, bench " <$" $ whnf ((1 :: Int ) <$ ) m
31
33
, bench " <$ really" $ nf ((2 :: Int ) <$ ) m
32
34
, bench " alterF lookup absent" $ whnf (atLookup evens) m_odd
Original file line number Diff line number Diff line change @@ -2966,6 +2966,9 @@ filter p m
2966
2966
2967
2967
filterWithKey :: (k -> a -> Bool ) -> Map k a -> Map k a
2968
2968
filterWithKey _ Tip = Tip
2969
+ filterWithKey p t@ (Bin 1 kx x _ _)
2970
+ | p kx x = t
2971
+ | otherwise = Tip
2969
2972
filterWithKey p t@ (Bin _ kx x l r)
2970
2973
| p kx x = if pl `ptrEq` l && pr `ptrEq` r
2971
2974
then t
You can’t perform that action at this time.
0 commit comments