mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
BorrowingSequence: estimatedCount ⟹ underestimatedCount
EstimatedCount is largely pointless. Knowing the exact count does enable a fast negative path for `elementsEqual`, but we can otherwise make do with just the (much simpler to understand/deal with) `underestimatedCount` that already exists on `Sequence`.
This commit is contained in:
12 files changed
+32
-104
No files matched your search
@@ -21,9 +21,8 @@ import ContainersPreview
|
||||
extension UniqueArray: BorrowingSequence where Element: ~Copyable {
|
||||
public typealias BorrowingIterator = RigidArray<Element>.BorrowingIterator
|
||||
|
||||
public var estimatedCount: EstimatedCount {
|
||||
.exactly(count)
|
||||
}
|
||||
@inlinable
|
||||
public var underestimatedCount: Int { count }
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
|
||||
Reference in new issue
Block a user