mirror of
				https://github.com/zeromq/libzmq.git
				synced 2025-11-04 12:17:39 +01:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -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++) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user