1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

perf(web): optimize byteLowerCase() (#12282)

This commit is contained in:
Aaron O'Mullan 2021-10-01 01:03:51 +02:00 committed by Ryan Dahl
parent 871dbb9f30
commit 864bf630ff

View file

@ -157,13 +157,9 @@
* @returns {string} * @returns {string}
*/ */
function byteLowerCase(s) { function byteLowerCase(s) {
return StringPrototypeReplace( // NOTE: correct since all callers convert to ByteString first
String(s), // TODO(@AaronO): maybe prefer a ByteString_Lower webidl converter
/[A-Z]/g, return StringPrototypeToLowerCase(s);
function byteUpperCaseReplace(c) {
return StringPrototypeToLowerCase(c);
},
);
} }
/** /**