on master help sign in
A tiny simplification
0be30cdBryan O'Sullivan
Data/Text.hs+1−2
@@ -627,8 +627,7 @@ replace needle@(Text _ _ neeLen)
627 | otherwise = Text (A.run x) 0 len
627 | otherwise = Text (A.run x) 0 len
628 where
628 where
629 ixs = indices needle haystack
629 ixs = indices needle haystack
630− cnt = L.length ixs
631− len = hayLen - (neeLen - repLen) * cnt
630+ len = hayLen - (neeLen - repLen) * L.length ixs
632 x = do
631 x = do
633 marr <- A.new len
632 marr <- A.new len
634 let loop (i:is) o d = do
633 let loop (i:is) o d = do