mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 02:42:58 +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 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};
|
||||||
|
Loading…
Reference in New Issue
Block a user