Skip to content

Commit 66a3b7b

Browse files
committed
Fix
1 parent 1525e59 commit 66a3b7b

File tree

1 file changed

+2
-2
lines changed
  • core/src/Streamly/Internal/Data/MutArray

1 file changed

+2
-2
lines changed

core/src/Streamly/Internal/Data/MutArray/Generic.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ unsafeSnoc, snocUnsafe :: MonadIO m => MutArray a -> a -> m (MutArray a)
422422
unsafeSnoc arr@MutArray {..} a = do
423423
assert (arrEnd < arrCapacity) (return ())
424424
let arr1 = arr {arrEnd = arrEnd + 1}
425-
unsafePutIndex arrEnd arr1 a
425+
unsafePutIndex (length arr) arr1 a
426426
return arr1
427427

428428
-- NOINLINE to move it out of the way and not pollute the instruction cache.
@@ -784,7 +784,7 @@ chunksOf n (D.Stream step state) =
784784
putIndexUnsafeWith end contents x
785785
let end1 = end + 1
786786
return $
787-
if start + end1 >= bound
787+
if end1 >= bound
788788
then D.Skip
789789
(GroupYield
790790
contents start end1 bound (GroupStart s))

0 commit comments

Comments
 (0)