Skip to content

Commit 1addabb

Browse files
Fix a stale reference bug in incrScanWith
1 parent 3fc8544 commit 1addabb

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

core/src/Streamly/Internal/Data/Scanl/Window.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ incrScanWith n (Scanl step1 initial1 extract1 final1) =
151151
Done b -> Done b
152152

153153
step (SWArray arr i st) a = do
154+
-- XXX compare this with the slidingWindow impl
154155
arr1 <- liftIO $ MutArray.unsafeSnoc arr a
155156
r <- step1 st (Insert a, RingArray.unsafeCastMutArray arr1)
156157
return $ case r of
@@ -166,7 +167,7 @@ incrScanWith n (Scanl step1 initial1 extract1 final1) =
166167
r <- step1 st (Replace a old, rb1)
167168
return $
168169
case r of
169-
Partial s -> Partial $ SWRing rb s
170+
Partial s -> Partial $ SWRing rb1 s
170171
Done b -> Done b
171172

172173
extract (SWArray _ _ st) = extract1 st

0 commit comments

Comments
 (0)