File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ codePointFromSurrogatePair lead trail | isLead lead && isTrail trail =
6262codePointFromSurrogatePair _ _ = Nothing
6363
6464unsurrogate :: Int -> Int -> CodePoint
65- unsurrogate h l = CodePoint ((h - 0xD800 ) * 0x400 + (l - 0xDC00 ) + 0x10000 )
65+ unsurrogate lead trail = CodePoint ((lead - 0xD800 ) * 0x400 + (trail - 0xDC00 ) + 0x10000 )
6666
6767isLead :: Int -> Boolean
6868isLead cu = 0xD800 <= cu && cu <= 0xDBFF
@@ -83,7 +83,7 @@ foreign import _unsafeCodePointAt0
8383
8484unsafeCodePointAt0Fallback :: String -> CodePoint
8585unsafeCodePointAt0Fallback s | String .length s == 1 = CodePoint (Unsafe .charCodeAt 0 s)
86- unsafeCodePointAt0Fallback s = CodePoint ((( lead - 0xD800 ) * 0x400 ) + ( trail - 0xDC00 ) + 0x10000 )
86+ unsafeCodePointAt0Fallback s = CodePoint (unsurrogate lead trail)
8787 where
8888 lead = Unsafe .charCodeAt 0 s
8989 trail = Unsafe .charCodeAt 1 s
You can’t perform that action at this time.
0 commit comments