Perf: minor optimization reducing array allocation
Some checks are pending
Build / Build (push) Waiting to run
Build / Diff output (push) Blocked by required conditions
Build / Deploy to Cloudflare Pages (push) Blocked by required conditions
Build / Deploy to GitHub and GitLab (push) Blocked by required conditions

This commit is contained in:
SukkaW
2025-03-02 19:49:18 +08:00
parent 8bb824dd0b
commit eabac5bfce
2 changed files with 2 additions and 2 deletions

View File

@@ -194,7 +194,7 @@ export class SurgeMitmSgmodule extends BaseWriteStrategy {
urlRegex = urlRegex.slice(9);
}
const potentialHostname = urlRegex.split('/')[0]
const potentialHostname = urlRegex.slice(0, urlRegex.indexOf('/'))
// pre process regex
.replaceAll(String.raw`\.`, '.')
.replaceAll('.+', '*')