File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -2101,9 +2101,9 @@ filterMapAux onLeaf onColl = go
2101
2101
ch <- A. read mary 0
2102
2102
case ch of
2103
2103
t | isLeafOrCollision t -> return t
2104
- _ -> BitmapIndexed b <$> A. trim mary 1
2104
+ _ -> BitmapIndexed b <$> ( A. unsafeFreeze =<< A. shrink mary 1 )
2105
2105
_ -> do
2106
- ary2 <- A. trim mary j
2106
+ ary2 <- A. unsafeFreeze =<< A. shrink mary j
2107
2107
return $! if j == maxChildren
2108
2108
then Full ary2
2109
2109
else BitmapIndexed b ary2
@@ -2130,7 +2130,7 @@ filterMapAux onLeaf onColl = go
2130
2130
return $! Leaf h l
2131
2131
_ | i == j -> do ary2 <- A. unsafeFreeze mary
2132
2132
return $! Collision h ary2
2133
- | otherwise -> do ary2 <- A. trim mary j
2133
+ | otherwise -> do ary2 <- A. unsafeFreeze =<< A. shrink mary j
2134
2134
return $! Collision h ary2
2135
2135
| Just el <- onColl $! A. index ary i
2136
2136
= A. write mary j el >> step ary mary (i+ 1 ) (j+ 1 ) n
Original file line number Diff line number Diff line change @@ -52,14 +52,14 @@ module Data.HashMap.Internal.Array
52
52
, insertM
53
53
, delete
54
54
, sameArray1
55
- , trim
56
55
57
56
, unsafeFreeze
58
57
, unsafeThaw
59
58
, unsafeSameArray
60
59
, run
61
60
, copy
62
61
, copyM
62
+ , cloneM
63
63
64
64
-- * Folds
65
65
, foldl
@@ -318,11 +318,6 @@ cloneM _mary@(MArray mary#) _off@(I# off#) _len@(I# len#) =
318
318
case cloneSmallMutableArray# mary# off# len# s of
319
319
(# s', mary'# # ) -> (# s', MArray mary'# # )
320
320
321
- -- | Create a new array of the @n@ first elements of @mary@.
322
- trim :: MArray s a -> Int -> ST s (Array a )
323
- trim mary n = cloneM mary 0 n >>= unsafeFreeze
324
- {-# INLINE trim #-}
325
-
326
321
-- | \(O(n)\) Insert an element at the given position in this array,
327
322
-- increasing its size by one.
328
323
insert :: Array e -> Int -> e -> Array e
You can’t perform that action at this time.
0 commit comments