mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
minor code beautification
This commit is contained in:
parent
0d704fceee
commit
c04583ff6c
10
src/pipe.cpp
10
src/pipe.cpp
@ -34,13 +34,16 @@ zmq::reader_t::reader_t (object_t *parent_,
|
||||
|
||||
zmq::reader_t::~reader_t ()
|
||||
{
|
||||
if (pipe)
|
||||
unregister_pipe (pipe);
|
||||
}
|
||||
|
||||
void zmq::reader_t::set_pipe (pipe_t *pipe_)
|
||||
{
|
||||
zmq_assert (!pipe);
|
||||
pipe = pipe_;
|
||||
peer = &pipe_->writer;
|
||||
peer = &pipe->writer;
|
||||
register_pipe (pipe);
|
||||
}
|
||||
|
||||
bool zmq::reader_t::check_read ()
|
||||
@ -125,7 +128,7 @@ void zmq::writer_t::set_pipe (pipe_t *pipe_)
|
||||
{
|
||||
zmq_assert (!pipe);
|
||||
pipe = pipe_;
|
||||
peer = &pipe_->reader;
|
||||
peer = &pipe->reader;
|
||||
}
|
||||
|
||||
bool zmq::writer_t::check_write (uint64_t size_)
|
||||
@ -180,7 +183,6 @@ zmq::pipe_t::pipe_t (object_t *reader_parent_, object_t *writer_parent_,
|
||||
{
|
||||
reader.set_pipe (this);
|
||||
writer.set_pipe (this);
|
||||
reader.register_pipe (this);
|
||||
}
|
||||
|
||||
zmq::pipe_t::~pipe_t ()
|
||||
@ -191,6 +193,4 @@ zmq::pipe_t::~pipe_t ()
|
||||
zmq_msg_t msg;
|
||||
while (read (&msg))
|
||||
zmq_msg_close (&msg);
|
||||
|
||||
reader.unregister_pipe (this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user