We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ebe947 commit b6ed146Copy full SHA for b6ed146
Data/HashMap/Base.hs
@@ -1948,9 +1948,12 @@ updateOrSnocWithKey f k0 v0 ary0 = go k0 v0 ary0 0 (A.length ary0)
1948
A.copy ary 0 mary 0 n
1949
A.write mary n (L k v)
1950
return mary
1951
- | otherwise = case A.index ary i of
1952
- (L kx y) | k == kx, (# v2 #) <- f k v y -> A.update ary i (L k v2)
1953
- | otherwise -> go k v ary (i+1) n
+ | L kx y <- A.index ary i
+ , k == kx
+ , (# v2 #) <- f k v y
1954
+ = A.update ary i (L k v2)
1955
+ | otherwise
1956
+ = go k v ary (i+1) n
1957
{-# INLINABLE updateOrSnocWithKey #-}
1958
1959
updateOrConcatWith :: Eq k => (v -> v -> v) -> A.Array (Leaf k v) -> A.Array (Leaf k v) -> A.Array (Leaf k v)
0 commit comments