Merge pull request #368 from hurtonm/code_cleanup

Small code simplification
This commit is contained in:
Pieter Hintjens 2012-06-09 07:13:30 -07:00
commit e9bfd76f87

View File

@ -84,11 +84,6 @@ int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_)
// subsequent part should be immediately available. // subsequent part should be immediately available.
bool fetched = pipes [current]->read (msg_); bool fetched = pipes [current]->read (msg_);
// Check the atomicity of the message. If we've already received the
// first part of the message we should get the remaining parts
// without blocking.
zmq_assert (!more || fetched);
// Note that when message is not fetched, current pipe is deactivated // Note that when message is not fetched, current pipe is deactivated
// and replaced by another active pipe. Thus we don't have to increase // and replaced by another active pipe. Thus we don't have to increase
// the 'current' pointer. // the 'current' pointer.
@ -101,6 +96,11 @@ int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_)
return 0; return 0;
} }
// Check the atomicity of the message.
// If we've already received the first part of the message
// we should get the remaining parts without blocking.
zmq_assert (!more);
active--; active--;
pipes.swap (current, active); pipes.swap (current, active);
if (current == active) if (current == active)