mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf/Refactor: faster ip version
This commit is contained in:
@@ -69,3 +69,7 @@ export function isDirectoryEmptySync(path: PathLike) {
|
||||
directoryHandle.closeSync();
|
||||
}
|
||||
}
|
||||
|
||||
export function fastIpVersion(ip: string) {
|
||||
return ip.includes(':') ? 6 : (ip.includes('.') ? 4 : 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user