Skip to content

Commit ac99505

Browse files
mdznrMatt Zanchelli
authored andcommitted
Clarify partitioningIndex(where:) behavior in inline documentation
The returned index isn’t necessarily an index of an element. In the case where it returns `endIndex`, it’s not valid for subscripting the collection. Resolves #170
1 parent 0830109 commit ac99505

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Algorithms/Partition.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ extension MutableCollection where Self: BidirectionalCollection {
168168
//===----------------------------------------------------------------------===//
169169

170170
extension Collection {
171-
/// Returns the index of the first element in the collection that matches
172-
/// the predicate.
171+
/// Returns the start index of the partition of a collection that matches
172+
/// the given predicate.
173173
///
174174
/// The collection must already be partitioned according to the predicate.
175175
/// That is, there should be an index `i` where for every element in

0 commit comments

Comments
 (0)