diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-10-01 01:03:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 01:03:51 +0200 |
commit | 7f390612a3192d944659d607a0ad71b58a612a0f (patch) | |
tree | c48293907df22e761c813be44bc0618f102b96a1 | |
parent | b3ceafaa5dfee4127dff155cf6f4cc210f22ab59 (diff) |
perf(web): optimize byteLowerCase() (#12282)
-rw-r--r-- | ext/web/00_infra.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/web/00_infra.js b/ext/web/00_infra.js index 7098c9577..55cd69f7c 100644 --- a/ext/web/00_infra.js +++ b/ext/web/00_infra.js @@ -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); } /** |