mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 21:44:24 +00:00
small sugar
This commit is contained in:
parent
b0fa68022a
commit
19d3d57d4c
@ -147,10 +147,10 @@ func `==`*(a, b: PeerInfo): bool =
|
||||
bptr = cast[pointer](b)
|
||||
|
||||
if isNil(aptr) and isNil(bptr):
|
||||
return true
|
||||
|
||||
if isNil(aptr) or isNil(bptr):
|
||||
return false
|
||||
|
||||
if aptr == bptr and a.peerId == b.peerId:
|
||||
return true
|
||||
true
|
||||
elif isNil(aptr) or isNil(bptr):
|
||||
false
|
||||
elif aptr == bptr and a.peerId == b.peerId:
|
||||
true
|
||||
else:
|
||||
false
|
||||
|
@ -65,7 +65,13 @@ func `==`*(a, b: PubSubPeer): bool =
|
||||
bptr = cast[pointer](b)
|
||||
|
||||
if isNil(aptr) and isNil(bptr):
|
||||
return true
|
||||
true
|
||||
elif isNil(aptr) or isNil(bptr):
|
||||
false
|
||||
elif aptr == bptr and a.peerInfo == b.peerInfo:
|
||||
true
|
||||
else:
|
||||
false
|
||||
|
||||
proc id*(p: PubSubPeer): string = p.peerInfo.id
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user