Minor Changes + Housekeeping

This commit is contained in:
SukkaW
2024-07-02 10:50:09 +08:00
parent b325f31990
commit dda0555c0b
8 changed files with 34 additions and 67 deletions

View File

@@ -426,15 +426,15 @@ class TimSort<T> {
this.tmp = new Array(this.tmpStorageLength);
this.stackLength = (
this.length < 120
? 5
: this.length < 1542
? 10
: this.length < 119151
? 19
: 40
);
if (this.length < 120) {
this.stackLength = 5;
} else if (this.length < 1542) {
this.stackLength = 10;
} else if (this.length < 119151) {
this.stackLength = 19;
} else {
this.stackLength = 40;
}
this.runStart = new Array(this.stackLength);
this.runLength = new Array(this.stackLength);