@@ -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