on master help sign in
Fix fencepost error
a2c3f36Bryan O'Sullivan
Data/Text/Fusion.hs+1−1
@@ -138,7 +138,7 @@ unstream (Stream next0 s0 len) = Text (fst a) 0 (snd a)
138 where
138 where
139 a = runST (A.unsafeNew len >>= (\arr -> loop arr 0 len s0))
139 a = runST (A.unsafeNew len >>= (\arr -> loop arr 0 len s0))
140 loop arr !i !top !s
140 loop arr !i !top !s
141− | i + 1 > top = case next0 s of
141+ | i + 1 >= top = case next0 s of
142 Done -> liftM2 (,) (A.unsafeFreeze arr) (return i)
142 Done -> liftM2 (,) (A.unsafeFreeze arr) (return i)
143 _ -> do
143 _ -> do
144 arr' <- A.unsafeNew (top*2)
144 arr' <- A.unsafeNew (top*2)