Problem: code duplication in equals/operator==

Solution: implemented equals using operator==
This commit is contained in:
Simon Giesecke 2018-04-13 11:21:05 -04:00
parent 799c89cb09
commit 4367bd6128

View File

@ -388,11 +388,7 @@ namespace zmq
ZMQ_DEPRECATED("from 4.3.0, use operator== instead")
inline bool equal(const message_t* other) const ZMQ_NOTHROW
{
if (size() != other->size())
return false;
const std::string a(data<char>(), size());
const std::string b(other->data<char>(), other->size());
return a == b;
return *this == *other;
}
inline bool operator==(const message_t &other) const ZMQ_NOTHROW