mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 07:00:43 +02:00
FileManager: Make use of insert_or_assign
Avoids some default constructions that get assigned over immediately.
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user