Listener: Simplify assignment within accept()

We can just assign to the ret variable directly.
This commit is contained in:
Lioncash 2019-09-03 10:15:31 -04:00
parent 4538b20e73
commit 33908dd86a
1 changed files with 6 additions and 6 deletions

View File

@ -91,14 +91,14 @@ void Listener::stop() {
std::unique_ptr<Endpoint> Listener::accept() { std::unique_ptr<Endpoint> Listener::accept() {
std::unique_lock lk{m_queueLock}; std::unique_lock lk{m_queueLock};
if (m_endpointQueue.size()) { if (m_endpointQueue.empty()) {
std::unique_ptr<Endpoint> ret; return nullptr;
ret = std::move(m_endpointQueue.front()); }
auto ret = std::move(m_endpointQueue.front());
m_endpointQueue.pop(); m_endpointQueue.pop();
return ret; return ret;
} }
return {};
}
Listener::Listener() = default; Listener::Listener() = default;