mirror of https://github.com/AxioDL/jbus.git
Listener: Simplify assignment within accept()
We can just assign to the ret variable directly.
This commit is contained in:
parent
4538b20e73
commit
33908dd86a
|
@ -91,13 +91,13 @@ 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;
|
||||||
|
|
Loading…
Reference in New Issue