From 1adcab885b53ab575431a7f0bf52ef6df1b5d5fa Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:03:12 +0800 Subject: [PATCH] remove unnecessary await (#24501) There is already a when condition, so `await` is not needed to split the function (cherry picked from commit 6bbf9c3117f4864a19be2ab34739f8a77760f5e2) --- lib/pure/httpclient.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 654bed27bc..381df8e979 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -864,7 +864,7 @@ proc parseResponse(client: HttpClient | AsyncHttpClient, while true: linei = 0 when client is HttpClient: - line = await client.socket.recvLine(client.timeout) + line = client.socket.recvLine(client.timeout) else: line = await client.socket.recvLine() if line == "": @@ -970,7 +970,7 @@ proc newConnection(client: HttpClient | AsyncHttpClient, else: nativesockets.Port(connectionUrl.port.parseInt) when client is HttpClient: - client.socket = await net.dial(connectionUrl.hostname, port) + client.socket = net.dial(connectionUrl.hostname, port) elif client is AsyncHttpClient: client.socket = await asyncnet.dial(connectionUrl.hostname, port) else: {.fatal: "Unsupported client type".}