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