Skip to content

Commit 896d4fc

Browse files
authored
Add efficiency docs for partitionPoint
1 parent 92b2190 commit 896d4fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/Prototypes/Algorithms.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,11 @@ extension Collection {
613613
/// The collection must already be partitioned according to the
614614
/// predicate, as if `self.partition(by: predicate)` had already
615615
/// been called.
616+
///
617+
/// - Efficiency: At most log(N) invocations of `predicate`, where
618+
/// N is the length of `self`. At most log(N) index offsetting
619+
/// operations if `self` conforms to `RandomAccessCollection`;
620+
/// at most N such operations otherwise.
616621
func partitionPoint(
617622
where predicate: (Element) throws -> Bool
618623
) rethrows -> Index {

0 commit comments

Comments
 (0)