Skip to content

Commit 645f98a

Browse files
committed
improve SortableSet performance
1 parent ec3fa8b commit 645f98a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/util/SortableSet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SortableSet extends Set {
3434
}
3535

3636
sortWith(/** @type {(a: any, b: any) => number} */ sortFn) {
37-
if (this.size === 0 || sortFn === this._lastActiveSortFn) {
37+
if (this.size <= 1 || sortFn === this._lastActiveSortFn) {
3838
// already sorted - nothing to do
3939
return;
4040
}

0 commit comments

Comments
 (0)