Skip to content

Commit e6b7cc6

Browse files
author
Matt Zanchelli
committed
Update comment
1 parent a8c33d5 commit e6b7cc6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/SwiftAlgorithmsTests/TestUtilities.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ func XCTAssertUnorderedEqualSequences<S1: Sequence, S2: Sequence>(
107107
missing.append(elt)
108108
continue
109109
}
110-
// Since ordering does not matter, this is a small
111-
// optmization that avoid removing a index in the middle
112-
// of the array and having to slide all elements.
110+
// Since ordering does not matter, avoid the performance costs of removing
111+
// an element at an index in the middle of the array, which requires
112+
// shifting all subsequent elements down.
113113
let lastIdx = s1.index(before: s1.endIndex)
114114
if lastIdx != idx {
115115
s1.swapAt(idx, lastIdx)

0 commit comments

Comments
 (0)