Skip to content

Commit 4367bd6

Browse files
committed
Problem: code duplication in equals/operator==
Solution: implemented equals using operator==
1 parent 799c89c commit 4367bd6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

zmq.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,7 @@ namespace zmq
388388
ZMQ_DEPRECATED("from 4.3.0, use operator== instead")
389389
inline bool equal(const message_t* other) const ZMQ_NOTHROW
390390
{
391-
if (size() != other->size())
392-
return false;
393-
const std::string a(data<char>(), size());
394-
const std::string b(other->data<char>(), other->size());
395-
return a == b;
391+
return *this == *other;
396392
}
397393

398394
inline bool operator==(const message_t &other) const ZMQ_NOTHROW

0 commit comments

Comments
 (0)