Pretty: simplified definition of realLength.
commit86d8e1ef8957b4a7809872189b626013e51bd3ab
authorJohn MacFarlane <jgm@berkeley.edu>
dateThu 23 Feb 2017, 09:54 (10 years ago)
parent9614835
src/Text/Pandoc/Pretty.hs+1−1
@@ -554,4 +554,4 @@ charWidth c =
554554-- | Get real length of string, taking into account combining and double-wide
555555-- characters.
556556realLength :: String -> Int
557−realLength = foldr (\a b -> charWidth a + b) 0
557+realLength = sum . map charWidth