on master help sign in
Merge pull request #50 from gridaphobe/master

Fix a bug in `Data.Text.Fusion.mapAccumL`

commit64149f29e962aff3b2756881aee9b2457ce355dc authorBryan O'Sullivan <bos@serpentine.com> dateSat 21 Sep 2013, 14:04 (13 years ago) parentb607bfce05ab76
1 file changed+3−3
Data/Text/Fusion.hs+3−3
Data/Text/Fusion.hs+3−3
@@ -223,9 +223,9 @@ mapAccumL f z0 (Stream next0 s0 len) = (nz,I.textP na 0 nl)
223223 arr' <- A.new top'
224224 A.copyM arr' 0 arr 0 top
225225 outer arr' top' z s i
226− | otherwise -> do let (z',c) = f z x
227− d <- unsafeWrite arr i c
226+ | otherwise -> do d <- unsafeWrite arr i c
228227 loop z' s' (i+d)
229− where j | ord x < 0x10000 = i
228+ where (z',c) = f z x
229+ j | ord c < 0x10000 = i
230230 | otherwise = i + 1
231231{-# INLINE [0] mapAccumL #-}