mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Add debugging
This commit is contained in:
@@ -162,10 +162,16 @@ public struct PeerId: Hashable, CustomStringConvertible, Comparable, Codable {
|
||||
self.id = Id(rawValue: Int64(bitPattern: idHighBits | idLowBits))
|
||||
}
|
||||
|
||||
assert(self.toInt64() == n)
|
||||
assert(self._toInt64() == n)
|
||||
}
|
||||
|
||||
public func toInt64() -> Int64 {
|
||||
let result = self._toInt64()
|
||||
assert(PeerId(result) == self)
|
||||
return result
|
||||
}
|
||||
|
||||
private func _toInt64() -> Int64 {
|
||||
let data = UInt64(bitPattern: self.id.rawValue)
|
||||
|
||||
let idLowBits = data & 0xffffffff
|
||||
@@ -191,8 +197,6 @@ public struct PeerId: Hashable, CustomStringConvertible, Comparable, Codable {
|
||||
result = Int64(bitPattern: data)
|
||||
}
|
||||
|
||||
assert(PeerId(result) == self)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user