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 8c20f7a commit 6a0fed1Copy full SHA for 6a0fed1
Data/HashMap/Internal.hs
@@ -982,8 +982,15 @@ two = go
982
where
983
bp1 = mask h1 s
984
bp2 = mask h2 s
985
- idx2 | index h1 s < index h2 s = 1
986
- | otherwise = 0
+ !(I# i1) = index h1 s
+ !(I# i2) = index h2 s
987
+ idx2 = I# (i1 Exts.<# i2)
988
+ -- This way of computing idx2 saves us a branch compared to the previous approach:
989
+ --
990
+ -- idx2 | index h1 s < index h2 s = 1
991
+ -- | otherwise = 0
992
993
+ -- See https://github.com/haskell-unordered-containers/unordered-containers/issues/75#issuecomment-1128419337
994
{-# INLINE two #-}
995
996
-- | \(O(\log n)\) Associate the value with the key in this map. If
0 commit comments