diff --git a/submodules/Postbox/Sources/Peer.swift b/submodules/Postbox/Sources/Peer.swift index 69c279993a..0f0cba4b37 100644 --- a/submodules/Postbox/Sources/Peer.swift +++ b/submodules/Postbox/Sources/Peer.swift @@ -132,6 +132,22 @@ public func arePeerDictionariesEqual(_ lhs: SimpleDictionary, _ 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