mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: minor optimization reducing array allocation
This commit is contained in:
@@ -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('.+', '*')
|
||||
|
||||
Reference in New Issue
Block a user