remove unnecessary await (#24501)

There is already a when condition, so `await` is not needed to split the
function

(cherry picked from commit 6bbf9c3117)
This commit is contained in:
ringabout
2024-12-04 19:03:12 +08:00
committed by narimiran
parent 5ddbf2372e
commit 1adcab885b

View File

@@ -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".}