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:
Karoy Lorentey committed 2026-03-05 15:33:27 -08:00
1 parent 4160bcb98d
commit 214d75cb73
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)