Skip to content

Commit 6c2c03d

Browse files
authored
Merge pull request #37892 from NevinBR/patch-2
2 parents 8f0235e + 1c94fbe commit 6c2c03d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stdlib/public/core/Sort.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,13 @@ internal func _merge<Element>(
400400
// After moving elements, the storage and buffer look like this, where
401401
// `x` is uninitialized memory:
402402
//
403-
// Storage: [4, 4, 7, 8, 9, 6, x, x, x, x, x]
404-
// ^ ^ ^
405-
// srcHigh destLow destHigh (past the end)
403+
// Storage: [4, 4, 7, 8, 9, 16, x, x, x, x, x]
404+
// ^ ^
405+
// srcHigh/destLow destHigh (past the end)
406406
//
407-
// Buffer: [8, 8, 10, 12, 15, x, ...]
408-
// ^ ^
409-
// bufferLow bufferHigh
407+
// Buffer: [8, 8, 10, 12, 15, x, ...]
408+
// ^ ^
409+
// bufferLow bufferHigh
410410
buffer.moveInitialize(from: mid, count: highCount)
411411
bufferHigh = bufferLow + highCount
412412

@@ -555,7 +555,7 @@ extension UnsafeMutableBufferPointer {
555555
// (a) - for all i in 2..<runs.count:
556556
// - runs[i - 2].count > runs[i - 1].count + runs[i].count
557557
// (b) - for c = runs.count - 1:
558-
// - runs[i - 1].count > runs[i].count
558+
// - runs[c - 1].count > runs[c].count
559559
//
560560
// Loop until the invariant is satisified for the top four elements of
561561
// `runs`. Because this method is called for every added run, and only

0 commit comments

Comments
 (0)