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,14 +91,14 @@ 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());
|
||||
if (m_endpointQueue.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto ret = std::move(m_endpointQueue.front());
|
||||
m_endpointQueue.pop();
|
||||
return ret;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Listener::Listener() = default;
|
||||
|
||||
|
|
Loading…
Reference in New Issue