FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

util: optimize toASCIILower function using V8s native toLowerCase · nodejs/node@09b5396 · GitHub

/ node Public

Commit 09b5396

Browse files
authored andcommitted
util: optimize toASCIILower function using V8s native toLowerCase
PR-URL: #61107 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 0692b4f commit 09b5396

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎lib/internal/mime.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const END_BEGINNING_WHITESPACE = /[^\r\n\t ]|$/;
2323
const START_ENDING_WHITESPACE = /[\r\n\t ]*$/;
2424

2525
function toASCIILower(str) {
26+
// eslint-disable-next-line no-control-regex
27+
if (!/[^\x00-\x7f]/.test(str)) return StringPrototypeToLowerCase(str);
2628
let result = '';
2729
for (let i = 0; i < str.length; i++) {
2830
const char = str[i];

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL