0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -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 GitHub
parent b3ceafaa5d
commit 7f390612a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
},
);
} }
/** /**