Problem: unnecessary procedural code

Solution: replace by functional expression
This commit is contained in:
Simon Giesecke 2018-08-15 12:42:11 +02:00
parent 3455be144d
commit fb576d2f95

View File

@ -688,16 +688,16 @@ int zmq::socket_base_t::connect (const char *addr_)
// The total HWM for an inproc connection should be the sum of // The total HWM for an inproc connection should be the sum of
// the binder's HWM and the connector's HWM. // the binder's HWM and the connector's HWM.
int sndhwm = 0; const int sndhwm = peer.socket == NULL
if (peer.socket == NULL) ? options.sndhwm
sndhwm = options.sndhwm; : options.sndhwm != 0 && peer.options.rcvhwm != 0
else if (options.sndhwm != 0 && peer.options.rcvhwm != 0) ? options.sndhwm + peer.options.rcvhwm
sndhwm = options.sndhwm + peer.options.rcvhwm; : 0;
int rcvhwm = 0; const int rcvhwm = peer.socket == NULL
if (peer.socket == NULL) ? options.rcvhwm
rcvhwm = options.rcvhwm; : options.rcvhwm != 0 && peer.options.sndhwm != 0
else if (options.rcvhwm != 0 && peer.options.sndhwm != 0) ? options.rcvhwm + peer.options.sndhwm
rcvhwm = options.rcvhwm + peer.options.sndhwm; : 0;
// Create a bi-directional pipe to connect the peers. // Create a bi-directional pipe to connect the peers.
object_t *parents[2] = {this, peer.socket == NULL ? this : peer.socket}; object_t *parents[2] = {this, peer.socket == NULL ? this : peer.socket};