mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-12 10:33:52 +01:00
Problem: creation of poller_events is unnecessarily complex
Solution: simplify code
This commit is contained in:
parent
f700e5d6b0
commit
3251d05636
@ -477,12 +477,10 @@ inline std::ostream& operator<<(std::ostream& os, const multipart_t& msg)
|
||||
int wait (std::chrono::milliseconds timeout)
|
||||
{
|
||||
if (need_rebuild) {
|
||||
poller_events.clear ();
|
||||
poller_events.resize (handlers.size ());
|
||||
poller_handlers.clear ();
|
||||
poller_events.reserve (handlers.size ());
|
||||
poller_handlers.reserve (handlers.size ());
|
||||
for (const auto &handler : handlers) {
|
||||
poller_events.emplace_back (zmq_poller_event_t {});
|
||||
poller_handlers.push_back (handler.second);
|
||||
}
|
||||
need_rebuild = false;
|
||||
|
Loading…
Reference in New Issue
Block a user