From 60b63ed5187a6242cf4c780aca7636162e62074e Mon Sep 17 00:00:00 2001 From: Hunter Laux Date: Mon, 31 Oct 2016 11:46:57 -0700 Subject: [PATCH] Remove an unnecessary while (true) This block of code will either return -1 or fall through. The while (true) does nothing. The braces limit the scope of int rc. --- src/zmq.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/zmq.cpp b/src/zmq.cpp index 8a6005c3..71e3010e 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -941,7 +941,7 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) timeout = end - now; // Wait for events. - while (true) { + { int rc = poll (pollfds, nitems_, timeout); if (rc == -1 && errno == EINTR) { if (pollfds != spollfds) @@ -949,7 +949,6 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) return -1; } errno_assert (rc >= 0); - break; } // Check for the events. for (int i = 0; i != nitems_; i++) {