fix wrong emplace usage
emplace already calls std::pair. No need for it again. No need to emplace when calling std::make_shared. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -193,11 +193,11 @@ UdisksNeighborExplorer::Insert(UDisks2::Object &&o) noexcept
|
||||
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
auto i = by_uri.emplace(std::make_pair(o.GetUri(), info));
|
||||
auto i = by_uri.emplace(o.GetUri(), info);
|
||||
if (!i.second)
|
||||
i.first->second = info;
|
||||
|
||||
by_path.emplace(std::make_pair(o.path, i.first));
|
||||
by_path.emplace(o.path, i.first);
|
||||
// TODO: do we need to remove a conflicting path?
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user