Simplify code for writer activation in Router socket

This commit is contained in:
Martin Hurton
2012-07-11 15:11:48 +02:00
parent f8752bf9fc
commit 6ac5cf8697

View File

@@ -117,15 +117,14 @@ void zmq::router_t::xread_activated (pipe_t *pipe_)
void zmq::router_t::xwrite_activated (pipe_t *pipe_) void zmq::router_t::xwrite_activated (pipe_t *pipe_)
{ {
for (outpipes_t::iterator it = outpipes.begin (); outpipes_t::iterator it;
it != outpipes.end (); ++it) { for (it = outpipes.begin (); it != outpipes.end (); ++it)
if (it->second.pipe == pipe_) { if (it->second.pipe == pipe_)
zmq_assert (!it->second.active); break;
it->second.active = true;
return; zmq_assert (it != outpipes.end ());
} zmq_assert (!it->second.active);
} it->second.active = true;
zmq_assert (false);
} }
int zmq::router_t::xsend (msg_t *msg_, int flags_) int zmq::router_t::xsend (msg_t *msg_, int flags_)