Skip to content

Commit

Permalink
perf(web): optimize byteLowerCase() (#12282)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronO authored Sep 30, 2021
1 parent b3ceafa commit 7f39061
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ext/web/00_infra.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 7f39061

Please sign in to comment.