]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: ssl: Remove useless loop in tlskeys_list_get_next()
authorTim Duesterhus <tim@bastelstu.be>
Sun, 3 Jan 2021 00:29:55 +0000 (01:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Jan 2021 09:24:36 +0000 (10:24 +0100)
This loop was always exited in the first iteration by `return`.

src/ssl_sock.c

index a5b854dce3456d658e12e08f9f02aeb2ee49cc20..6374781a98ca48e9aebf9ab3f753516669241793 100644 (file)
@@ -6360,17 +6360,14 @@ struct tls_keys_ref *tlskeys_list_get_next(struct tls_keys_ref *getnext, struct
 {
        struct tls_keys_ref *ref = getnext;
 
-       while (1) {
+       /* Get next list entry. */
+       ref = LIST_NEXT(&ref->list, struct tls_keys_ref *, list);
 
-               /* Get next list entry. */
-               ref = LIST_NEXT(&ref->list, struct tls_keys_ref *, list);
-
-               /* If the entry is the last of the list, return NULL. */
-               if (&ref->list == end)
-                       return NULL;
+       /* If the entry is the last of the list, return NULL. */
+       if (&ref->list == end)
+               return NULL;
 
-               return ref;
-       }
+       return ref;
 }
 
 static inline