Skip to content

Commit f804efd

Browse files
authored
Merge pull request swiftlang#25430 from natecook1000/nc-prefixwhile-degyb
2 parents 8f56771 + 55f9be3 commit f804efd

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

stdlib/public/core/PrefixWhile.swift

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313

1414
/// A sequence whose elements consist of the initial consecutive elements of
1515
/// some base sequence that satisfy a given predicate.
16+
///
17+
/// - Note: When `LazyPrefixWhileSequence` wraps a collection type, the
18+
/// performance of accessing `endIndex` depends on how many
19+
/// elements satisfy the predicate at the start of the collection, and might
20+
/// not offer the usual performance given by the `Collection` protocol.
21+
/// Accessing `endIndex`, the `last` property, or calling methods that
22+
/// depend on moving indices might not have the documented complexity.
1623
@frozen // lazy-performance
1724
public struct LazyPrefixWhileSequence<Base: Sequence> {
1825
public typealias Element = Base.Element
@@ -98,15 +105,14 @@ extension LazySequenceProtocol {
98105
}
99106
}
100107

101-
/// A lazy `${Collection}` wrapper that includes the initial consecutive
108+
/// A lazy collection wrapper that includes the initial consecutive
102109
/// elements of an underlying collection that satisfy a predicate.
103110
///
104-
/// - Note: The performance of accessing `endIndex`, `last`, any methods that
105-
/// depend on `endIndex`, or moving an index depends on how many elements
106-
/// satisfy the predicate at the start of the collection, and may not offer
107-
/// the usual performance given by the `Collection` protocol. Be aware,
108-
/// therefore, that general operations on `${Self}` instances may not have
109-
/// the documented complexity.
111+
/// - Note: The performance of accessing `endIndex` depends on how many
112+
/// elements satisfy the predicate at the start of the collection, and might
113+
/// not offer the usual performance given by the `Collection` protocol.
114+
/// Accessing `endIndex`, the `last` property, or calling methods that
115+
/// depend on moving indices might not have the documented complexity.
110116
public typealias LazyPrefixWhileCollection<T: Collection> = LazyPrefixWhileSequence<T>
111117

112118
extension LazyPrefixWhileCollection {

0 commit comments

Comments
 (0)