Skip to content

Commit 2aac1df

Browse files
committed
Problem: bad code style in operator==
Solution: simplified code
1 parent 4d04187 commit 2aac1df

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

zmq.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,8 @@ namespace zmq
393393

394394
inline bool operator==(const message_t &other) const ZMQ_NOTHROW
395395
{
396-
size_t my_size = size ();
397-
if (size () != other.size ())
398-
return false;
399-
return 0 == memcmp (data (), other.data (), my_size);
396+
const size_t my_size = size ();
397+
return my_size == other.size () && 0 == memcmp (data (), other.data (), my_size);
400398
}
401399

402400
inline bool operator!=(const message_t &other) const ZMQ_NOTHROW

0 commit comments

Comments
 (0)