summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-10-01 01:03:51 +0200
committerGitHub <noreply@github.com>2021-10-01 01:03:51 +0200
commit7f390612a3192d944659d607a0ad71b58a612a0f (patch)
treec48293907df22e761c813be44bc0618f102b96a1
parentb3ceafaa5dfee4127dff155cf6f4cc210f22ab59 (diff)
perf(web): optimize byteLowerCase() (#12282)
-rw-r--r--ext/web/00_infra.js10
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);
}
/**