Don't leak space when passing the undecoded portion to the next iteration.
commit184241641cf9e008a5d54b87d0136b85e298bfe4
authorTom Ellis <tom-2013@purelyagile.com>
dateFri 15 May 2015, 10:29 (11 years ago)
parent0fdeebd
Data/Text/Encoding.hs+1−1
@@ -286,7 +286,7 @@ streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
286286 return $! text arr 0 (fromIntegral n)
287287 lastPtr <- peek curPtrPtr
288288 let left = lastPtr `minusPtr` curPtr
289− undecoded = case state of
289+ !undecoded = case state of
290290 UTF8_ACCEPT -> B.empty
291291 _ -> B.append undecoded0 (B.drop left bs)
292292 return $ Some chunkText undecoded