mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Modernize sort code (#18824)
* Replace bodies of Comparable versions with calls to sort(by:) * Make _insertionSort a method * Make _sort3 a method * Make _partition a method * Make _introSort a method * Make _siftDown, _heapify, _heapsort methods * Other minor cleanup
This commit is contained in:
@@ -243,7 +243,7 @@ Algorithm.test("sort3/stable")
|
||||
]) {
|
||||
// decorate with offset, but sort by value
|
||||
var input = Array($0.enumerated())
|
||||
_sort3(&input, 0, 1, 2) { $0.element < $1.element }
|
||||
input._sort3(0, 1, 2) { $0.element < $1.element }
|
||||
// offsets should still be ordered for equal values
|
||||
expectTrue(isSorted(input) {
|
||||
if $0.element == $1.element {
|
||||
|
||||
Reference in New Issue
Block a user