From 7f390612a3192d944659d607a0ad71b58a612a0f Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Fri, 1 Oct 2021 01:03:51 +0200 Subject: perf(web): optimize byteLowerCase() (#12282) --- ext/web/00_infra.js | 10 +++------- 1 file 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); } /** -- cgit v1.2.3