git.iko.soy/typeable/pandoc
on master help sign in
Pretty: simplified definition of realLength.
86d8e1eJohn MacFarlane
src/Text/Pandoc/Pretty.hs+1−1
@@ -554,4 +554,4 @@ charWidth c =
554-- | Get real length of string, taking into account combining and double-wide
554-- | Get real length of string, taking into account combining and double-wide
555-- characters.
555-- characters.
556realLength :: String -> Int
556realLength :: String -> Int
557−realLength = foldr (\a b -> charWidth a + b) 0
557+realLength = sum . map charWidth