mirror of https://github.com/AxioDL/boo.git
DeviceFinder: Make use of unordered_map's emplace within _insertToken
Same thing, but less reading.
This commit is contained in:
parent
6cc5b30127
commit
90485ac1b9
|
@ -41,7 +41,7 @@ bool DeviceFinder::_insertToken(std::unique_ptr<DeviceToken>&& token) {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_tokensLock.lock();
|
m_tokensLock.lock();
|
||||||
TInsertedDeviceToken insertedTok = m_tokens.insert(std::make_pair(token->getDevicePath(), std::move(token)));
|
const TInsertedDeviceToken insertedTok = m_tokens.emplace(token->getDevicePath(), std::move(token));
|
||||||
m_tokensLock.unlock();
|
m_tokensLock.unlock();
|
||||||
deviceConnected(*insertedTok.first->second);
|
deviceConnected(*insertedTok.first->second);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue