mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 18:40:27 +01:00
Problem: unnecessary procedural code
Solution: replace by functional expression
This commit is contained in:
parent
3455be144d
commit
fb576d2f95
@ -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 binder's HWM and the connector's HWM.
|
||||
int sndhwm = 0;
|
||||
if (peer.socket == NULL)
|
||||
sndhwm = options.sndhwm;
|
||||
else if (options.sndhwm != 0 && peer.options.rcvhwm != 0)
|
||||
sndhwm = options.sndhwm + peer.options.rcvhwm;
|
||||
int rcvhwm = 0;
|
||||
if (peer.socket == NULL)
|
||||
rcvhwm = options.rcvhwm;
|
||||
else if (options.rcvhwm != 0 && peer.options.sndhwm != 0)
|
||||
rcvhwm = options.rcvhwm + peer.options.sndhwm;
|
||||
const int sndhwm = peer.socket == NULL
|
||||
? options.sndhwm
|
||||
: options.sndhwm != 0 && peer.options.rcvhwm != 0
|
||||
? options.sndhwm + peer.options.rcvhwm
|
||||
: 0;
|
||||
const int rcvhwm = peer.socket == NULL
|
||||
? options.rcvhwm
|
||||
: options.rcvhwm != 0 && peer.options.sndhwm != 0
|
||||
? options.rcvhwm + peer.options.sndhwm
|
||||
: 0;
|
||||
|
||||
// Create a bi-directional pipe to connect the peers.
|
||||
object_t *parents[2] = {this, peer.socket == NULL ? this : peer.socket};
|
||||
|
Loading…
Reference in New Issue
Block a user