From 0f3d024c0ae53a9c96a7dd33f2ade95cb890740a Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Sat, 31 Aug 2019 13:12:49 -0600 Subject: [PATCH] avoid unnecesary temps --- libp2p/identify.nim | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libp2p/identify.nim b/libp2p/identify.nim index cf619938c..084e4be23 100644 --- a/libp2p/identify.nim +++ b/libp2p/identify.nim @@ -77,13 +77,9 @@ proc decodeMsg*(buf: seq[byte]): IdentifyInfo = if pb.getBytes(4, observableAddr) > 0: # attempt to read the observed addr result.observedAddr = MultiAddress.init(observableAddr) - var protoVersion = "" - discard pb.getString(5, protoVersion) - result.protoVersion = protoVersion + discard pb.getString(5, result.protoVersion) - var agentVersion = "" - discard pb.getString(6, agentVersion) - result.agentVersion = agentVersion + discard pb.getString(6, result.agentVersion) method init*(p: Identify) = proc handle(conn: Connection, proto: string) {.async, gcsafe.} =