Commit 47dba210 authored by Simon Giesecke's avatar Simon Giesecke

Problem: code is unnecessarily imperative

Solution: make more functional-style
parent bfec30b1
...@@ -751,19 +751,8 @@ void zmq::session_base_t::start_connecting_udp (io_thread_t * /*io_thread_*/) ...@@ -751,19 +751,8 @@ void zmq::session_base_t::start_connecting_udp (io_thread_t * /*io_thread_*/)
udp_engine_t *engine = new (std::nothrow) udp_engine_t (options); udp_engine_t *engine = new (std::nothrow) udp_engine_t (options);
alloc_assert (engine); alloc_assert (engine);
bool recv = false; const bool recv = options.type == ZMQ_DISH || options.type == ZMQ_DGRAM;
bool send = false; const bool send = options.type == ZMQ_RADIO || options.type == ZMQ_DGRAM;
if (options.type == ZMQ_RADIO) {
send = true;
recv = false;
} else if (options.type == ZMQ_DISH) {
send = false;
recv = true;
} else if (options.type == ZMQ_DGRAM) {
send = true;
recv = true;
}
const int rc = engine->init (_addr, send, recv); const int rc = engine->init (_addr, send, recv);
errno_assert (rc == 0); errno_assert (rc == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment