File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,11 @@ foreign import _unsafeCodePointAt0
7979
8080unsafeCodePointAt0Fallback :: String -> CodePoint
8181unsafeCodePointAt0Fallback s =
82+ let cu0 = Unsafe .charCodeAt 0 s in
83+ let cu1 = Unsafe .charCodeAt 1 s in
8284 if isLead cu0 && isTrail cu1
8385 then unsurrogate cu0 cu1
8486 else CodePoint cu0
85- where
86- cu0 = Unsafe .charCodeAt 0 s
87- cu1 = Unsafe .charCodeAt 1 s
8887
8988
9089-- | Returns the first code point of the string after dropping the given number
@@ -198,10 +197,10 @@ foreign import _singleton
198197
199198singletonFallback :: CodePoint -> String
200199singletonFallback (CodePoint cp) | cp <= 0xFFFF = fromCharCode cp
201- singletonFallback (CodePoint cp) = fromCharCode lead <> fromCharCode trail
202- where
203- lead = (( cp - 0x10000 ) / 0x400 ) + 0xD800
204- trail = (cp - 0x10000 ) `mod` 0x400 + 0xDC00
200+ singletonFallback (CodePoint cp) =
201+ let lead = ((cp - 0x10000 ) / 0x400 ) + 0xD800 in
202+ let trail = (cp - 0x10000 ) `mod` 0x400 + 0xDC00 in
203+ fromCharCode lead <> fromCharCode trail
205204
206205
207206-- | Returns a record with strings created from the code points on either side
You can’t perform that action at this time.
0 commit comments