We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0a795e commit ee4c673Copy full SHA for ee4c673
src/core/tree.ts
@@ -12,8 +12,6 @@ export interface TreeNodeOptions extends ResolvedOptions {
12
treeNodeOptions?: TreeNodeValueOptions
13
}
14
15
-const stringCompare = new Intl.Collator('en', {}).compare
16
-
17
export class TreeNode {
18
/**
19
* value of the node
@@ -149,7 +147,9 @@ export class TreeNode {
149
147
* @internal
150
148
*/
151
static compare(a: TreeNode, b: TreeNode): number {
152
- return stringCompare(a.path, b.path)
+ // for this case, ASCII, short list, it's better than Internation Collator
+ // https://stackoverflow.com/questions/77246375/why-localecompare-can-be-faster-than-collator-compare
+ return a.path.localeCompare(b.path, 'en')
153
154
155
0 commit comments