Break early when pipe to be removed was found

This commit is contained in:
Stefan Radomski 2012-12-04 17:41:08 +01:00
parent fbfd3c34d9
commit 2131e85cd7

View File

@ -1012,12 +1012,10 @@ void zmq::socket_base_t::terminated (pipe_t *pipe_)
xterminated (pipe_); xterminated (pipe_);
// Remove pipe from inproc pipes // Remove pipe from inproc pipes
inprocs_t::iterator it = inprocs.begin(); for (inprocs_t::iterator it = inprocs.begin(); it != inprocs.end(); ++it) {
while (it != inprocs.end()) {
if (it->second == pipe_) { if (it->second == pipe_) {
inprocs.erase(it++); inprocs.erase(it);
} else { break;
it++;
} }
} }