FileManager: Make use of insert_or_assign

Avoids some default constructions that get assigned over immediately.
This commit is contained in:
Lioncash committed 2021-06-10 21:38:39 -04:00
1 parent 340919d0fb
commit 10ec1d5d15
1 file changed
+4 -4
@@ -349,8 +349,8 @@ uint64_t FileManager::Openat([[maybe_unused]] int dirfs, const char *pathname, i
}
if (fd != -1) {
std::lock_guard<std::mutex> lk(FDLock);
FDToNameMap[fd] = SelfPath;
std::lock_guard lk(FDLock);
FDToNameMap.insert_or_assign(fd, SelfPath);
}
return fd;
@@ -378,8 +378,8 @@ uint64_t FileManager::Openat2(int dirfs, const char *pathname, FEX::HLE::open_ho
}
if (fd != -1) {
std::lock_guard<std::mutex> lk(FDLock);
FDToNameMap[fd] = SelfPath;
std::lock_guard lk(FDLock);
FDToNameMap.insert_or_assign(fd, SelfPath);
}
return fd;