Skip to content

Commit

Permalink
Internal.Strict: update16 --> update32
Browse files Browse the repository at this point in the history
  • Loading branch information
doyougnu committed Nov 2, 2021
1 parent dc31905 commit 79b9eea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Data/HashMap/Internal/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ insertWith f k0 v0 m0 = go h0 k0 v0 0 m0
go h k x s (Full ary) =
let st = A.index ary i
st' = go h k x (s+bitsPerSubkey) st
ary' = update16 ary i $! st'
ary' = update32 ary i $! st'
in Full ary'
where i = index h s
go h k x s t@(Collision hy v)
Expand Down Expand Up @@ -266,7 +266,7 @@ adjust f k0 m0 = go h0 k0 0 m0
let i = index h s
st = A.index ary i
st' = go h k (s+bitsPerSubkey) st
ary' = update16 ary i $! st'
ary' = update32 ary i $! st'
in Full ary'
go h k _ t@(Collision hy v)
| h == hy = Collision h (updateWith f k v)
Expand Down Expand Up @@ -494,12 +494,12 @@ unionWithKey f = go 0
go s (Full ary1) t2 =
let h2 = leafHashCode t2
i = index h2 s
ary' = update16With' ary1 i $ \st1 -> go (s+bitsPerSubkey) st1 t2
ary' = update32With' ary1 i $ \st1 -> go (s+bitsPerSubkey) st1 t2
in Full ary'
go s t1 (Full ary2) =
let h1 = leafHashCode t1
i = index h1 s
ary' = update16With' ary2 i $ \st2 -> go (s+bitsPerSubkey) t1 st2
ary' = update32With' ary2 i $ \st2 -> go (s+bitsPerSubkey) t1 st2
in Full ary'

leafHashCode (Leaf h _) = h
Expand Down

0 comments on commit 79b9eea

Please sign in to comment.