mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-31 14:39:56 +01:00
Problem: code duplication in equals/operator==
Solution: implemented equals using operator==
This commit is contained in:
parent
799c89cb09
commit
4367bd6128
6
zmq.hpp
6
zmq.hpp
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user