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:
Pieter Hintjens
2016-02-06 13:32:23 +01:00
parent c8318912f5
commit 27a8961c37
5 changed files with 7 additions and 10 deletions

View File

@@ -97,8 +97,7 @@ int zmq::router_t::xsetsockopt (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;
switch (option_) {
case ZMQ_CONNECT_RID: