From 26a4510377fa56cc8abbce52423286a85945aa70 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 12 Feb 2020 13:05:28 -0500 Subject: [PATCH] remove unnecesary nil check in peerinfo --- libp2p/peerinfo.nim | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libp2p/peerinfo.nim b/libp2p/peerinfo.nim index 9d4c17dcf..4baf20861 100644 --- a/libp2p/peerinfo.nim +++ b/libp2p/peerinfo.nim @@ -105,13 +105,9 @@ proc publicKey*(p: PeerInfo): Option[PublicKey] {.inline.} = result = some(p.privateKey.getKey()) proc id*(p: PeerInfo): string {.inline.} = - if not isNil(p): - result = p.peerId.pretty() + p.peerId.pretty() proc `$`*(p: PeerInfo): string = - if isNil(p): - return "" - result.add("PeerID: ") result.add(p.id & "\n")