Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upString reversing supporting astral characters and combining unicode chars #627
Conversation
eoftedal
added some commits
May 26, 2016
eoftedal
referenced this pull request
May 26, 2016
Closed
String.reverse doesn't handle unicode characters properly #625
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eoftedal
commented
May 26, 2016
|
Partial fix of: https://github.com/elm-lang/core/issues/625 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@eoftedal what are the performance effects of this change? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
et
commented
Sep 23, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Pilatch
Dec 15, 2016
If there are performance implications, which I'd bet there are, maybe this could instead become another function.
Pilatch
commented
Dec 15, 2016
|
If there are performance implications, which I'd bet there are, maybe this could instead become another function. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eoftedal
Dec 16, 2016
To be honest, I don't know the performance implications. I also don't know if people use a string reversing function enough that that matters. I can't really think of many valid use cases for it.
eoftedal
commented
Dec 16, 2016
|
To be honest, I don't know the performance implications. I also don't know if people use a string reversing function enough that that matters. I can't really think of many valid use cases for it. |
eoftedal
added some commits
Dec 16, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eoftedal
commented
Dec 16, 2016
|
Array.from(str).length seems to be about 10 times slower than str.length |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eoftedal
commented
Dec 16, 2016
|
[...str].length seems to be about twice as fast as Array.from(str).length |
eoftedal
added some commits
Dec 16, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 25, 2017
Member
Fixed in elm-lang@8ca9c38 with proof that speed is equal or faster here and tests in elm-lang@d796fca.
|
Fixed in elm-lang@8ca9c38 with proof that speed is equal or faster here and tests in elm-lang@d796fca. |
eoftedal commentedMay 26, 2016
Code borrowed from @mathiasbynens:
https://github.com/mathiasbynens/esrever/blob/master/esrever.js