mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: repalce String#localeCompare w/ simple ASCII-only compare
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
// enough when sorting.
|
||||
import * as tldts from 'tldts-experimental';
|
||||
import { looseTldtsOpt } from '../constants/loose-tldts-opt';
|
||||
import { fastStringCompare } from './misc';
|
||||
|
||||
export function compare(a: string, b: string) {
|
||||
if (a === b) return 0;
|
||||
return (a.length - b.length) || a.localeCompare(b);
|
||||
return (a.length - b.length) || fastStringCompare(a, b);
|
||||
}
|
||||
|
||||
export function buildParseDomainMap(inputs: string[]) {
|
||||
|
||||
Reference in New Issue
Block a user