We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 222811a commit 76b5afcCopy full SHA for 76b5afc
stdlib/public/core/HashedCollections.swift.gyb
@@ -762,7 +762,7 @@ public struct Set<Element : Hashable> :
762
/// - Parameter sequence: The elements to use as members of the new set.
763
public init<Source : Sequence>(_ sequence: Source)
764
where Source.Iterator.Element == Element {
765
- self.init()
+ self.init(minimumCapacity: sequence.underestimatedCount)
766
if let s = sequence as? Set<Element> {
767
// If this sequence is actually a native `Set`, then we can quickly
768
// adopt its native storage and let COW handle uniquing only
0 commit comments