mirror of
https://github.com/apple/swift-collections
synced 2026-11-26 04:47:48 +00:00
Merge pull request #214 from lorentey/OrderedSet-doc-updates
[OrderedSet] Small doc updates/fixes
This commit is contained in:
2 files changed
+6
-4
No files matched your search
@@ -49,11 +49,13 @@ extension OrderedSet {
|
||||
/// Creates a new set from a finite sequence of items.
|
||||
///
|
||||
/// - Parameter elements: The elements to use as members of the new set.
|
||||
/// The sequence is allowed to contain duplicate elements, but only
|
||||
/// the first duplicate instance is preserved in the result.
|
||||
///
|
||||
/// - Complexity: This operation is expected to perform O(*n*)
|
||||
/// comparisons on average (where *n* is the number of elements
|
||||
/// in the sequence), provided that `Element` implements
|
||||
/// high-quality hashing.
|
||||
/// hashing and equality comparisons on average (where *n*
|
||||
/// is the number of elements in the sequence), provided that
|
||||
/// `Element` properly implements hashing.
|
||||
@inlinable
|
||||
public init<S: Sequence>(_ elements: S) where S.Element == Element {
|
||||
if S.self == Self.self {
|
||||
|
||||
@@ -55,7 +55,7 @@ extension OrderedSet {
|
||||
///
|
||||
/// - Returns: The element equal to `member` if `member` is contained in the
|
||||
/// set; otherwise, `nil`. In some cases, the returned element may be
|
||||
/// distinguishable from `newMember` by identity comparison or some other
|
||||
/// distinguishable from `member` by identity comparison or some other
|
||||
/// means.
|
||||
///
|
||||
/// - Complexity: O(`count`). Removing an element from the middle of the
|
||||
|
||||
Reference in new issue
Block a user