Commit 05460af7 authored by Jakob Otto's avatar Jakob Otto

Include review feedback

parent 7a8cac4b
...@@ -100,12 +100,14 @@ public: ...@@ -100,12 +100,14 @@ public:
bool handle_write_event(endpoint_manager& manager) override { bool handle_write_event(endpoint_manager& manager) override {
CAF_LOG_TRACE(CAF_ARG2("handle", this->handle_.id) CAF_LOG_TRACE(CAF_ARG2("handle", this->handle_.id)
<< CAF_ARG2("queue-size", packet_queue_.size())); << CAF_ARG2("queue-size", packet_queue_.size()));
auto get_message = [&] { auto fetch_next_message = [&] {
if (auto msg = manager.next_message()) if (auto msg = manager.next_message()) {
this->next_layer_.write_message(*this, std::move(msg)); this->next_layer_.write_message(*this, std::move(msg));
return !packet_queue_.empty(); return true;
}
return false;
}; };
while (write_some() && get_message()) while (write_some() && fetch_next_message())
; // nop ; // nop
return !packet_queue_.empty(); return !packet_queue_.empty();
} }
......
...@@ -107,12 +107,14 @@ public: ...@@ -107,12 +107,14 @@ public:
bool handle_write_event(endpoint_manager& manager) override { bool handle_write_event(endpoint_manager& manager) override {
CAF_LOG_TRACE(CAF_ARG2("handle", this->handle_.id) CAF_LOG_TRACE(CAF_ARG2("handle", this->handle_.id)
<< CAF_ARG2("queue-size", write_queue_.size())); << CAF_ARG2("queue-size", write_queue_.size()));
auto get_message = [&] { auto fetch_next_message = [&] {
if (auto msg = manager.next_message()) if (auto msg = manager.next_message()) {
this->next_layer_.write_message(*this, std::move(msg)); this->next_layer_.write_message(*this, std::move(msg));
return !write_queue_.empty(); return true;
}
return false;
}; };
while (write_some() && get_message()) while (write_some() && fetch_next_message())
; // nop ; // nop
return !write_queue_.empty(); return !write_queue_.empty();
} }
......
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