diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-12-07 00:12:50 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-12-07 00:12:50 -0800 |
commit | dc16f21d981044db8478c9dfb0ee2145370b5b5f (patch) | |
tree | 2937992b32a6ba254d134c46f869a79dae7a18c0 /src | |
parent | ad242131b9c9da653f3304f8bd5a791e6dca4ad8 (diff) | |
parent | 9761283c8fd58fa04d9e04b45ef9a30325dc342e (diff) | |
download | pandoc-dc16f21d981044db8478c9dfb0ee2145370b5b5f.tar.gz |
Merge pull request #1790 from mpickering/master
Text.Pandoc.Pretty: Improve performance of realLength
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Pretty.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs index 9ee7fe94a..2f2656086 100644 --- a/src/Text/Pandoc/Pretty.hs +++ b/src/Text/Pandoc/Pretty.hs @@ -534,4 +534,4 @@ charWidth c = -- | Get real length of string, taking into account combining and double-wide -- characters. realLength :: String -> Int -realLength = sum . map charWidth +realLength = foldr (\a b -> charWidth a + b) 0 |