diff --git a/include/tscore/List.h b/include/tscore/List.h index 695fd4715ad..57809badcd8 100644 --- a/include/tscore/List.h +++ b/include/tscore/List.h @@ -337,10 +337,10 @@ template struct DLL { self_type operator++(int); /// Equality. - bool operator==(self_type const &that); + bool operator==(self_type const &that) const; /// Inequality. - bool operator!=(self_type const &that); + bool operator!=(self_type const &that) const; protected: const_iterator(C *spot) : _spot(spot) {} @@ -515,14 +515,14 @@ DLL::const_iterator::operator++(int) -> self_type template bool -DLL::const_iterator::operator==(DLL::const_iterator::self_type const &that) +DLL::const_iterator::operator==(DLL::const_iterator::self_type const &that) const { return _spot == that._spot; } template bool -DLL::const_iterator::operator!=(DLL::const_iterator::self_type const &that) +DLL::const_iterator::operator!=(DLL::const_iterator::self_type const &that) const { return _spot != that._spot; } diff --git a/include/tscore/Ptr.h b/include/tscore/Ptr.h index c2ff69a59ad..c6dc46525d3 100644 --- a/include/tscore/Ptr.h +++ b/include/tscore/Ptr.h @@ -120,7 +120,7 @@ template class Ptr } bool - operator==(const Ptr &p) + operator==(const Ptr &p) const { return (m_ptr == p.m_ptr); } diff --git a/iocore/eventsystem/I_IOBuffer.h b/iocore/eventsystem/I_IOBuffer.h index d72a80c97d5..ae9920fbdd1 100644 --- a/iocore/eventsystem/I_IOBuffer.h +++ b/iocore/eventsystem/I_IOBuffer.h @@ -1411,7 +1411,7 @@ IOBufferChain::operator=(self_type const &that) inline IOBufferChain & IOBufferChain::operator+=(self_type const &that) { - if (nullptr == _head) + if (_head == nullptr) *this = that; else { _tail->next = that._head; diff --git a/plugins/s3_auth/aws_auth_v4_wrap.h b/plugins/s3_auth/aws_auth_v4_wrap.h index 72221c3b89b..c0bbf69b8b1 100644 --- a/plugins/s3_auth/aws_auth_v4_wrap.h +++ b/plugins/s3_auth/aws_auth_v4_wrap.h @@ -62,12 +62,12 @@ class HeaderIterator return tmp; } bool - operator!=(const HeaderIterator &it) + operator!=(const HeaderIterator &it) const { return _bufp != it._bufp || _hdrs != it._hdrs || _field != it._field; } bool - operator==(const HeaderIterator &it) + operator==(const HeaderIterator &it) const { return _bufp == it._bufp && _hdrs == it._hdrs && _field == it._field; } diff --git a/proxy/hdrs/MIME.h b/proxy/hdrs/MIME.h index 162340e75a2..97bbd381e91 100644 --- a/proxy/hdrs/MIME.h +++ b/proxy/hdrs/MIME.h @@ -275,8 +275,8 @@ struct MIMEHdrImpl : public HdrHeapObjImpl { self_type &operator++(); self_type operator++(int); - bool operator==(self_type const &that); - bool operator!=(self_type const &that); + bool operator==(self_type const &that) const; + bool operator!=(self_type const &that) const; protected: MIMEFieldBlockImpl *_block = nullptr; ///< Current block. @@ -384,13 +384,13 @@ MIMEHdrImpl::iterator::operator->() -> pointer } inline bool -MIMEHdrImpl::iterator::operator==(const self_type &that) +MIMEHdrImpl::iterator::operator==(const self_type &that) const { return _block == that._block && _slot == that._slot; } inline bool -MIMEHdrImpl::iterator::operator!=(const self_type &that) +MIMEHdrImpl::iterator::operator!=(const self_type &that) const { return _block != that._block || _slot != that._slot; }