From: Ian Lynagh Date: Fri, 10 Jul 2009 00:40:32 +0000 (+0000) Subject: Use the result of writeCharBuf in GHC/IO/Encoding/Latin1.hs too X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=1b560628a4e06b88e43e0a76354a12fba0d44796;p=ghc-base.git Use the result of writeCharBuf in GHC/IO/Encoding/Latin1.hs too --- diff --git a/GHC/IO/Encoding/Latin1.hs b/GHC/IO/Encoding/Latin1.hs index 99b2af3..97b198c 100644 --- a/GHC/IO/Encoding/Latin1.hs +++ b/GHC/IO/Encoding/Latin1.hs @@ -83,8 +83,8 @@ latin1_decode | ow >= os || ir >= iw = done ir ow | otherwise = do c0 <- readWord8Buf iraw ir - writeCharBuf oraw ow (unsafeChr (fromIntegral c0)) - loop (ir+1) (ow+1) + ow' <- writeCharBuf oraw ow (unsafeChr (fromIntegral c0)) + loop (ir+1) ow' -- lambda-lifted, to avoid thunks being built in the inner-loop: done !ir !ow = return (if ir == iw then input{ bufL=0, bufR=0 }