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…
Reference in New Issue