From 10078a922583587e8d82aa5ca81e352566787ab5 Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Thu, 18 Feb 2021 20:38:42 +0000 Subject: [PATCH] Problem: Unused member variables _last_in Solution: Remove them --- src/dgram.cpp | 5 ----- src/dgram.hpp | 2 -- src/fq.cpp | 7 +------ src/fq.hpp | 5 ----- src/pair.cpp | 7 +------ src/pair.hpp | 2 -- 6 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/dgram.cpp b/src/dgram.cpp index 879ff4da..437b4819 100644 --- a/src/dgram.cpp +++ b/src/dgram.cpp @@ -39,7 +39,6 @@ zmq::dgram_t::dgram_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), _pipe (NULL), - _last_in (NULL), _more_out (false) { options.type = ZMQ_DGRAM; @@ -71,9 +70,6 @@ void zmq::dgram_t::xattach_pipe (pipe_t *pipe_, void zmq::dgram_t::xpipe_terminated (pipe_t *pipe_) { if (pipe_ == _pipe) { - if (_last_in == _pipe) { - _last_in = NULL; - } _pipe = NULL; } } @@ -147,7 +143,6 @@ int zmq::dgram_t::xrecv (msg_t *msg_) errno = EAGAIN; return -1; } - _last_in = _pipe; return 0; } diff --git a/src/dgram.hpp b/src/dgram.hpp index 51385aad..d84dac69 100644 --- a/src/dgram.hpp +++ b/src/dgram.hpp @@ -62,8 +62,6 @@ class dgram_t ZMQ_FINAL : public socket_base_t private: zmq::pipe_t *_pipe; - zmq::pipe_t *_last_in; - // If true, more outgoing message parts are expected. bool _more_out; diff --git a/src/fq.cpp b/src/fq.cpp index 2a700977..d3dfeab6 100644 --- a/src/fq.cpp +++ b/src/fq.cpp @@ -33,7 +33,7 @@ #include "err.hpp" #include "msg.hpp" -zmq::fq_t::fq_t () : _active (0), _last_in (NULL), _current (0), _more (false) +zmq::fq_t::fq_t () : _active (0), _current (0), _more (false) { } @@ -62,10 +62,6 @@ void zmq::fq_t::pipe_terminated (pipe_t *pipe_) _current = 0; } _pipes.erase (pipe_); - - if (_last_in == pipe_) { - _last_in = NULL; - } } void zmq::fq_t::activated (pipe_t *pipe_) @@ -100,7 +96,6 @@ int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_) *pipe_ = _pipes[_current]; _more = (msg_->flags () & msg_t::more) != 0; if (!_more) { - _last_in = _pipes[_current]; _current = (_current + 1) % _active; } return 0; diff --git a/src/fq.hpp b/src/fq.hpp index 26724101..ed019126 100644 --- a/src/fq.hpp +++ b/src/fq.hpp @@ -65,11 +65,6 @@ class fq_t // beginning of the pipes array. pipes_t::size_type _active; - // Pointer to the last pipe we received message from. - // NULL when no message has been received or the pipe - // has terminated. - pipe_t *_last_in; - // Index of the next bound pipe to read a message from. pipes_t::size_type _current; diff --git a/src/pair.cpp b/src/pair.cpp index f3bfe34b..d1fb80b1 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -36,8 +36,7 @@ zmq::pair_t::pair_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), - _pipe (NULL), - _last_in (NULL) + _pipe (NULL) { options.type = ZMQ_PAIR; } @@ -67,9 +66,6 @@ void zmq::pair_t::xattach_pipe (pipe_t *pipe_, void zmq::pair_t::xpipe_terminated (pipe_t *pipe_) { if (pipe_ == _pipe) { - if (_last_in == _pipe) { - _last_in = NULL; - } _pipe = NULL; } } @@ -117,7 +113,6 @@ int zmq::pair_t::xrecv (msg_t *msg_) errno = EAGAIN; return -1; } - _last_in = _pipe; return 0; } diff --git a/src/pair.hpp b/src/pair.hpp index 2d7bc071..74996d3b 100644 --- a/src/pair.hpp +++ b/src/pair.hpp @@ -62,8 +62,6 @@ class pair_t ZMQ_FINAL : public socket_base_t private: zmq::pipe_t *_pipe; - zmq::pipe_t *_last_in; - ZMQ_NON_COPYABLE_NOR_MOVABLE (pair_t) }; }