From 6ac5cf8697b50b5e6afb6582b067840adac02981 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Wed, 11 Jul 2012 15:11:48 +0200 Subject: [PATCH] Simplify code for writer activation in Router socket --- src/router.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/router.cpp b/src/router.cpp index 81275f65..ab133b97 100644 --- a/src/router.cpp +++ b/src/router.cpp @@ -117,15 +117,14 @@ void zmq::router_t::xread_activated (pipe_t *pipe_) void zmq::router_t::xwrite_activated (pipe_t *pipe_) { - for (outpipes_t::iterator it = outpipes.begin (); - it != outpipes.end (); ++it) { - if (it->second.pipe == pipe_) { - zmq_assert (!it->second.active); - it->second.active = true; - return; - } - } - zmq_assert (false); + outpipes_t::iterator it; + for (it = outpipes.begin (); it != outpipes.end (); ++it) + if (it->second.pipe == pipe_) + break; + + zmq_assert (it != outpipes.end ()); + zmq_assert (!it->second.active); + it->second.active = true; } int zmq::router_t::xsend (msg_t *msg_, int flags_)