From 1462580556aa27a98819e58f74264cd00d8cd5d6 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 10 Nov 2022 13:35:30 +0300 Subject: [PATCH] Simplify code: sockets are already equal to -1 --- dht-bootstrap.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dht-bootstrap.c b/dht-bootstrap.c index 33ef798..e98cd6e 100644 --- a/dht-bootstrap.c +++ b/dht-bootstrap.c @@ -506,18 +506,10 @@ main(int argc, char **argv) token_bucket_tokens = MAX_TOKEN_BUCKET_TOKENS; int send4 = 0; struct pollfd fds[2]; - if (dht_socket >= 0) { - fds[0].fd = dht_socket; - fds[0].events = POLLIN; - } else { - fds[0].fd = -1; - } - if (dht_socket6 >= 0) { - fds[1].fd = dht_socket6; - fds[1].events = POLLIN; - } else { - fds[1].fd = -1; - } + fds[0].fd = dht_socket; + fds[0].events = POLLIN; + fds[1].fd = dht_socket6; + fds[1].events = POLLIN; while (1) { int tv_sec = 0; -- 2.44.0