mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Improve arePeerDictionariesEqual
This commit is contained in:
parent
eee1e96dc2
commit
fad2291e56
@ -132,6 +132,22 @@ public func arePeerDictionariesEqual(_ lhs: SimpleDictionary<PeerId, Peer>, _ rh
|
||||
return true
|
||||
}
|
||||
|
||||
public func arePeerDictionariesEqual(_ lhs: [PeerId: Peer], _ rhs: [PeerId: Peer]) -> Bool {
|
||||
if lhs.count != rhs.count {
|
||||
return false
|
||||
}
|
||||
for (id, lhsPeer) in lhs {
|
||||
if let rhsPeer = rhs[id] {
|
||||
if !lhsPeer.isEqual(rhsPeer) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
public struct PeerSummaryCounterTags: OptionSet, Sequence, Hashable {
|
||||
public var rawValue: Int32
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user