diff --git a/zmq.hpp b/zmq.hpp index 2e72db6..970132a 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -393,11 +393,10 @@ namespace zmq inline bool operator==(const message_t &other) const ZMQ_NOTHROW { + size_t my_size = size (); if (size () != other.size ()) return false; - const std::string a(data(), size()); - const std::string b(other.data(), other.size()); - return a == b; + return 0 == memcmp (data (), other.data (), my_size); } inline bool operator!=(const message_t &other) const ZMQ_NOTHROW