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 92e4b2a commit 5a439ccCopy full SHA for 5a439cc
Data/HashMap/Internal.hs
@@ -1882,6 +1882,15 @@ intersectionCollisions f ary1 ary2 = do
1882
pure (maryLen, mary)
1883
{-# INLINE intersectionCollisions #-}
1884
1885
+-- | Say we have
1886
+-- @
1887
+-- 1 2 3 4
1888
1889
+-- and we search for @3@. Then we can mutate the array to
1890
1891
+-- undefined 2 1 4
1892
1893
+-- We don't actually need to write undefined, we just have to make sure that the next search starts 1 after the current one.
1894
searchSwap :: Eq k => k -> Int -> A.MArray s (Leaf k v) -> ST s (Maybe (Leaf k v))
1895
searchSwap toFind start = go start toFind start
1896
where
0 commit comments