small sugar
This commit is contained in:
parent
b0fa68022a
commit
19d3d57d4c
|
@ -147,10 +147,10 @@ func `==`*(a, b: PeerInfo): bool =
|
||||||
bptr = cast[pointer](b)
|
bptr = cast[pointer](b)
|
||||||
|
|
||||||
if isNil(aptr) and isNil(bptr):
|
if isNil(aptr) and isNil(bptr):
|
||||||
return true
|
true
|
||||||
|
elif isNil(aptr) or isNil(bptr):
|
||||||
if isNil(aptr) or isNil(bptr):
|
false
|
||||||
return false
|
elif aptr == bptr and a.peerId == b.peerId:
|
||||||
|
true
|
||||||
if aptr == bptr and a.peerId == b.peerId:
|
else:
|
||||||
return true
|
false
|
||||||
|
|
|
@ -65,7 +65,13 @@ func `==`*(a, b: PubSubPeer): bool =
|
||||||
bptr = cast[pointer](b)
|
bptr = cast[pointer](b)
|
||||||
|
|
||||||
if isNil(aptr) and isNil(bptr):
|
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
|
proc id*(p: PubSubPeer): string = p.peerInfo.id
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue