Merge pull request #1790 from mpickering/master

Text.Pandoc.Pretty: Improve performance of realLength
This commit is contained in:
John MacFarlane 2014-12-07 00:12:50 -08:00
commit dc16f21d98

View file

@ -534,4 +534,4 @@ charWidth c =
-- | Get real length of string, taking into account combining and double-wide -- | Get real length of string, taking into account combining and double-wide
-- characters. -- characters.
realLength :: String -> Int realLength :: String -> Int
realLength = sum . map charWidth realLength = foldr (\a b -> charWidth a + b) 0