Commit 942384d
committed
Fix: Handle reverse-sorted lists with duplicates in presorted check
- Updated `_handlePresorted` and '_handlePresortedBy' to treat non-increasing sequences (e.g., [3, 2, 2, 1])
as reverse-sorted, allowing O(n) reversal instead of O(n log n) sorting.1 parent 8029a6a commit 942384d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
| 590 | + | |
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
774 | | - | |
| 774 | + | |
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
| |||
0 commit comments