mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-19 18:04:56 +00:00
fs: Remove some unnecessary string conversions
This commit is contained in:
parent
10a7110c7d
commit
3c8b3f9a29
3 changed files with 9 additions and 14 deletions
|
@ -131,14 +131,9 @@ File* HandleTable::GetFile(int d) {
|
|||
return m_files.at(d - RESERVED_HANDLES);
|
||||
}
|
||||
|
||||
File* HandleTable::getFile(const std::string& host_name) {
|
||||
std::scoped_lock lock{m_mutex};
|
||||
for (auto* file : m_files) {
|
||||
if (file != nullptr && file->m_host_name == host_name) {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
File* HandleTable::GetFile(const std::filesystem::path& host_name) {
|
||||
const auto it = std::ranges::find(m_files, host_name, &File::m_host_name);
|
||||
return it == m_files.end() ? nullptr : *it;
|
||||
}
|
||||
|
||||
} // namespace Core::FileSys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue