1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 08:33:43 -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}
*/
function byteLowerCase(s) {
return StringPrototypeReplace(
String(s),
/[A-Z]/g,
function byteUpperCaseReplace(c) {
return StringPrototypeToLowerCase(c);
},
);
// NOTE: correct since all callers convert to ByteString first
// TODO(@AaronO): maybe prefer a ByteString_Lower webidl converter
return StringPrototypeToLowerCase(s);
}
/**