Remove the unnecessary initFuture in the LibP2P p2pProtocol back-end

This commit is contained in:
Zahary Karadjov 2020-04-15 05:33:52 +03:00
parent 6513cd9eff
commit bac6248301
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 3 additions and 5 deletions

View File

@ -532,6 +532,9 @@ proc setBody*(sendProc: SendProc, body: NimNode) =
proc writeParamsAsRecord*(params: openarray[NimNode],
outputStream, Format, RecordType: NimNode): NimNode =
if params.len == 0:
return newStmtList()
var
appendParams = newStmtList()
recordWriterCtx = ident "recordWriterCtx"
@ -568,7 +571,6 @@ proc useStandardBody*(sendProc: SendProc,
outputStream = ident "outputStream"
msgBytes = ident "msgBytes"
initFuture = bindSym "initFuture"
recipient = sendProc.peerParam
msgRecName = msg.recName
Format = msg.protocol.backend.SerializationFormat
@ -584,9 +586,6 @@ proc useStandardBody*(sendProc: SendProc,
appendParams = newStmtList()
initResultFuture = if msg.kind != msgRequest: newStmtList()
else: newCall(initFuture, resultIdent)
sendCall = sendCallGenerator(recipient, msgBytes)
tracing = when not tracingEnabled:
@ -600,7 +599,6 @@ proc useStandardBody*(sendProc: SendProc,
sendProc.setBody quote do:
mixin init, WriterType, beginRecord, endRecord, getOutput
`initResultFuture`
var `outputStream` = memoryOutput()
`preSerialization`
`serilization`