on master help sign in
A tiny simplification
commit0be30cd8d21b206602bfe00ea19f16e16c2327d5 authorBryan O'Sullivan <bos@serpentine.com> dateTue 3 Dec 2013, 22:31 (13 years ago) parent1aa063b
1 file changed+1−2
Data/Text.hs+1−2
Data/Text.hs+1−2
@@ -627,8 +627,7 @@ replace needle@(Text _ _ neeLen)
627627 | otherwise = Text (A.run x) 0 len
628628 where
629629 ixs = indices needle haystack
630− cnt = L.length ixs
631− len = hayLen - (neeLen - repLen) * cnt
630+ len = hayLen - (neeLen - repLen) * L.length ixs
632631 x = do
633632 marr <- A.new len
634633 let loop (i:is) o d = do