Skip to content

Commit

Permalink
Consistently use lookupResToMaybe (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjakobi authored May 10, 2022
1 parent 455ad49 commit f4bf21d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Data/HashMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1426,9 +1426,7 @@ alterFEager f !k m = (<$> f mv) $ \case

where !h = hash k
!lookupRes = lookupRecordCollision h k m
!mv = case lookupRes of
Absent -> Nothing
Present v _ -> Just v
!mv = lookupResToMaybe lookupRes
{-# INLINABLE alterFEager #-}

-- | \(O(n \log m)\) Inclusion of maps. A map is included in another map if the keys
Expand Down
4 changes: 1 addition & 3 deletions Data/HashMap/Internal/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,7 @@ alterFEager f !k !m = (<$> f mv) $ \fres ->

where !h = hash k
!lookupRes = HM.lookupRecordCollision h k m
!mv = case lookupRes of
Absent -> Nothing
Present v _ -> Just v
!mv = HM.lookupResToMaybe lookupRes
{-# INLINABLE alterFEager #-}

------------------------------------------------------------------------
Expand Down

0 comments on commit f4bf21d

Please sign in to comment.