Correct complexity statement for Sequence compactMap

This commit is contained in:
William Entriken
2022-05-28 14:59:46 -04:00
committed by GitHub
parent e9fb9091b8
commit 81b0d3a27f

View File

@@ -787,8 +787,7 @@ extension Sequence {
/// - Returns: An array of the non-`nil` results of calling `transform` /// - Returns: An array of the non-`nil` results of calling `transform`
/// with each element of the sequence. /// with each element of the sequence.
/// ///
/// - Complexity: O(*m* + *n*), where *n* is the length of this sequence /// - Complexity: O(*n*), where *n* is the length of this sequence.
/// and *m* is the length of the result.
@inlinable // protocol-only @inlinable // protocol-only
public func compactMap<ElementOfResult>( public func compactMap<ElementOfResult>(
_ transform: (Element) throws -> ElementOfResult? _ transform: (Element) throws -> ElementOfResult?