From e7168f30e6fdf0a1f9cffdc9252f52d45e5a59ef Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 3 Jun 2020 15:46:25 -0700 Subject: Do not use else after return or break for better code readability [clang-tidy] Found with readability-else-after-return Signed-off-by: Rosen Penev --- common/socket.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/socket.c b/common/socket.c index bcccbae..354e6a4 100644 --- a/common/socket.c +++ b/common/socket.c @@ -738,14 +738,14 @@ static int32_t _sockaddr_in6_scope_id(struct sockaddr_in6* addr) if (addr->sin6_scope_id == addr_in->sin6_scope_id) { res = addr_in->sin6_scope_id; break; - } else { - if ((addr_in->sin6_scope_id > addr->sin6_scope_id) && (res >= 0)) { - // use last valid scope id as we're past the requested scope id - break; - } - res = addr_in->sin6_scope_id; - continue; } + + if ((addr_in->sin6_scope_id > addr->sin6_scope_id) && (res >= 0)) { + // use last valid scope id as we're past the requested scope id + break; + } + res = addr_in->sin6_scope_id; + continue; } /* skip loopback interface if not already matched exactly above */ -- cgit v1.1-32-gdbae