From: Daniel Gustafsson Date: Fri, 30 Jul 2021 07:40:15 +0000 (+0200) Subject: connect: remove superfluous conditional X-Git-Tag: curl-7_79_0~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df8d08d00a82f0bfc076ca1000abb209e0b9770;p=thirdparty%2Fcurl.git connect: remove superfluous conditional Commit dbd16c3e2 cleaned up the logic for traversing the addrinfos, but the move left a conditional on ai which no longer is needed as the while loop reevaluation will cover it. Closes #7511 Reviewed-by: Carlo Marcelo Arenas Belón Reviewed-by: Daniel Stenberg --- diff --git a/lib/connect.c b/lib/connect.c index 11e6b888b7..a6a0627185 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -589,12 +589,10 @@ static CURLcode trynextip(struct Curl_easy *data, struct Curl_addrinfo *ai = conn->tempaddr[tempindex]; while(ai) { - if(ai) { - result = singleipconnect(data, conn, ai, tempindex); - if(result == CURLE_COULDNT_CONNECT) { - ai = ainext(conn, tempindex, TRUE); - continue; - } + result = singleipconnect(data, conn, ai, tempindex); + if(result == CURLE_COULDNT_CONNECT) { + ai = ainext(conn, tempindex, TRUE); + continue; } break; }