From: Tim Duesterhus Date: Sun, 3 Jan 2021 00:29:55 +0000 (+0100) Subject: CLEANUP: ssl: Remove useless loop in tlskeys_list_get_next() X-Git-Tag: v2.4-dev5~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c7bb33144d1cb89962f592062c9450870b662af;p=thirdparty%2Fhaproxy.git CLEANUP: ssl: Remove useless loop in tlskeys_list_get_next() This loop was always exited in the first iteration by `return`. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index a5b854dce3..6374781a98 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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