]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
connect: remove superfluous conditional
authorDaniel Gustafsson <daniel@yesql.se>
Fri, 30 Jul 2021 07:40:15 +0000 (09:40 +0200)
committerDaniel Gustafsson <daniel@yesql.se>
Fri, 30 Jul 2021 07:40:15 +0000 (09:40 +0200)
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 <daniel@haxx.se>
lib/connect.c

index 11e6b888b78c4f75ab00258cbe480586677d0e04..a6a06271850c5750c348e087cfe81dfc51d0bcd4 100644 (file)
@@ -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;
     }