Skip to content

Commit

Permalink
Tweak union.goDifferentHash (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjakobi authored Dec 6, 2021
1 parent b5758c7 commit 46080fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Data/HashMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ unionWithKey f = go 0
leafHashCode _ = error "leafHashCode"

goDifferentHash s h1 h2 t1 t2
| m1 == m2 = BitmapIndexed m1 (A.singleton $! go (s+bitsPerSubkey) t1 t2)
| m1 == m2 = BitmapIndexed m1 (A.singleton $! goDifferentHash (s+bitsPerSubkey) h1 h2 t1 t2)
| m1 < m2 = BitmapIndexed (m1 .|. m2) (A.pair t1 t2)
| otherwise = BitmapIndexed (m1 .|. m2) (A.pair t2 t1)
where
Expand Down
2 changes: 1 addition & 1 deletion Data/HashMap/Internal/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ unionWithKey f = go 0
leafHashCode _ = error "leafHashCode"

goDifferentHash s h1 h2 t1 t2
| m1 == m2 = BitmapIndexed m1 (A.singleton $! go (s+bitsPerSubkey) t1 t2)
| m1 == m2 = BitmapIndexed m1 (A.singleton $! goDifferentHash (s+bitsPerSubkey) h1 h2 t1 t2)
| m1 < m2 = BitmapIndexed (m1 .|. m2) (A.pair t1 t2)
| otherwise = BitmapIndexed (m1 .|. m2) (A.pair t2 t1)
where
Expand Down

0 comments on commit 46080fa

Please sign in to comment.