mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 04:17:57 +01:00
Problem: resolution of int optval_ was made more verbose
There's no value in this as the same pattern is repeated in several places and it's fair to expect people to understand it. Solution: revert to the old, one-liner style.
This commit is contained in:
@@ -92,8 +92,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
size_t optvallen_)
|
||||
{
|
||||
bool is_int = (optvallen_ == sizeof (int));
|
||||
int value = 0;
|
||||
if (is_int) memcpy(&value, optval_, sizeof (int));
|
||||
int value = is_int? *((int *) optval_): 0;
|
||||
#if defined (ZMQ_ACT_MILITANT)
|
||||
bool malformed = true; // Did caller pass a bad option value?
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user