mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-24 04:17:48 +00:00
add doc on suffix method
This commit is contained in:
1 parent
813ea7905e
commit
08e424ea07
1 file changed
+9
@@ -14,6 +14,15 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
extension BidirectionalCollection {
|
||||
/// Returns a subsequence containing the elements from the end until `predicate`
|
||||
/// returns `false` and skipping the remaining elements.
|
||||
///
|
||||
/// - Parameter predicate: A closure that takes an element of the
|
||||
/// sequence as its argument and returns `true` if the element should
|
||||
/// be included or `false` if it should be excluded. Once the predicate
|
||||
/// returns `false` it will not be called again.
|
||||
///
|
||||
/// - Complexity: O(*n*), where *n* is the length of the collection.
|
||||
public func suffix(
|
||||
while predicate: (Element) throws -> Bool
|
||||
) rethrows -> SubSequence {
|
||||
|
||||
Reference in new issue
Block a user