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:
parent
871dbb9f30
commit
864bf630ff
1 changed files with 3 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue