Some fixes

This commit is contained in:
Yuriy Glukhov 2018-07-10 12:54:27 +03:00
parent 6ac6397d33
commit cf6b4d3084
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ requires "nim > 0.18.0",
"ranges",
"stint",
"byteutils",
"chronicles",
"https://github.com/status-im/nim-asyncdispatch2"
proc runTest(name: string, lang = "c") = exec "nim " & lang & " -r tests/" & name

View File

@ -391,7 +391,7 @@ proc resolveResponseFuture(peer: Peer, msgId: int, msg: pointer, reqId: int) =
for req in outstandingReqs:
if not req.future.finished: break
inc expiredRequests
outstandingReqs.shrink(fromFront = expiredRequests)
outstandingReqs.shrink(fromFirst = expiredRequests)
if outstandingReqs.len > 0:
let oldestReq = outstandingReqs.popFirst
assert oldestReq.reqId == -1
@ -422,7 +422,7 @@ proc resolveResponseFuture(peer: Peer, msgId: int, msg: pointer, reqId: int) =
if idx != outstandingReqs.len - 1:
req = outstandingReqs.popLast
else:
outstandingReqs.shrink(fromEnd = 1)
outstandingReqs.shrink(fromLast = 1)
# This was the last item, so we don't have any
# more work to do:
return
@ -434,7 +434,7 @@ proc resolveResponseFuture(peer: Peer, msgId: int, msg: pointer, reqId: int) =
if idx != outstandingReqs.len - 1:
req = outstandingReqs.popLast
else:
outstandingReqs.shrink(fromEnd = 1)
outstandingReqs.shrink(fromLast = 1)
return
inc idx