File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -422,13 +422,13 @@ delete ary idx = runST (deleteM ary idx)
422422-- | /O(n)/ Delete an element at the given position in this array,
423423-- decreasing its size by one.
424424deleteM :: Array e -> Int -> ST s (Array e )
425- deleteM ary idx = do
425+ deleteM ary0 idx = do
426426 CHECK_BOUNDS (" deleteM" , count, idx)
427- do mary <- new_ (count - 1 )
428- copy ary 0 mary 0 idx
429- copy ary (idx+ 1 ) mary idx (count- (idx+ 1 ))
430- unsafeFreeze mary
431- where ! count = length ary
427+ do mary0 <- unsafeThaw ary0
428+ mary1 <- cloneM mary0 0 (count - 1 )
429+ copy ary0 (idx+ 1 ) mary1 idx (count- (idx+ 1 ))
430+ unsafeFreeze mary1
431+ where ! count = length ary0
432432{-# INLINE deleteM #-}
433433
434434map :: (a -> b ) -> Array a -> Array b
You can’t perform that action at this time.
0 commit comments