-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Labels
type: enhancementA new feature or addition.A new feature or addition.
Description
It seems to me that these lines in Data.String.CodePoints.uncons
purescript-strings/src/Data/String/CodePoints.purs
Lines 197 to 198 in 157e372
cu0 = fromEnum (Unsafe.charAt 0 s) | |
cu1 = fromEnum (Unsafe.charAt 1 s) |
are first slicing the first code unit into a Char
string with the JavaScript charAt
method
if (i >= 0 && i < s.length) return s.charAt(i); |
and then converting the Char
string to a CodePoint
by the boundedEnumChar
instance fromEnum
method which calls the Javascript charCodeAt
method.
We could skip the intermediate string slice of the charAt
method and call charCodeAt
directly.
Metadata
Metadata
Assignees
Labels
type: enhancementA new feature or addition.A new feature or addition.