mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-27 04:34:21 +00:00
Remove collection conformances to Equatable and Hashable (#124)
This commit is contained in:
1 parent
bcdbac800a
commit
abc5559ef6
14 files changed
+2
-209
No files matched your search
@@ -179,48 +179,3 @@ extension CompactedCollection: LazySequenceProtocol
|
||||
where Base: LazySequenceProtocol {}
|
||||
extension CompactedCollection: LazyCollectionProtocol
|
||||
where Base: LazyCollectionProtocol {}
|
||||
|
||||
|
||||
// Hashable and Equatable conformance are based on each non-nil
|
||||
// element on base collection.
|
||||
extension CompactedSequence: Equatable
|
||||
where Base.Element: Equatable {
|
||||
|
||||
@inlinable
|
||||
public static func ==(lhs: CompactedSequence,
|
||||
rhs: CompactedSequence) -> Bool {
|
||||
lhs.elementsEqual(rhs)
|
||||
}
|
||||
}
|
||||
|
||||
extension CompactedSequence: Hashable
|
||||
where Element: Hashable {
|
||||
|
||||
@inlinable
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
for element in self {
|
||||
hasher.combine(element)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension CompactedCollection: Equatable
|
||||
where Base.Element: Equatable {
|
||||
|
||||
@inlinable
|
||||
public static func ==(lhs: CompactedCollection,
|
||||
rhs: CompactedCollection) -> Bool {
|
||||
lhs.elementsEqual(rhs)
|
||||
}
|
||||
}
|
||||
|
||||
extension CompactedCollection: Hashable
|
||||
where Element: Hashable {
|
||||
|
||||
@inlinable
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
for element in self {
|
||||
hasher.combine(element)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user