git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
small optimisation in encodeChar
commit618c99086115928654d957a1c46f84f3d8cc11ac authorMichael Ficarra <github@michael.ficarra.me> dateWed 11 Nov 2015, 11:41 (11 years ago) parent80ce898
1 file changed+1−1
src/Language/PureScript/Pretty/JS.hs+1−1
src/Language/PureScript/Pretty/JS.hs+1−1
@@ -164,7 +164,7 @@ string s = '"' : concatMap encodeChar s ++ "\""
164164 encodeChar '\r' = "\\r"
165165 encodeChar '"' = "\\\""
166166 encodeChar '\\' = "\\\\"
167− encodeChar c | fromEnum c > 0xFFFF = "\\u" ++ showHex highSurrogate "" ++ "\\u" ++ showHex lowSurrogate ""
167+ encodeChar c | fromEnum c > 0xFFFF = "\\u" ++ showHex highSurrogate ("\\u" ++ showHex lowSurrogate "")
168168 where
169169 (h, l) = divMod (fromEnum c - 0x10000) 0x400
170170 highSurrogate = h + 0xD800