FileSystems: Change multiple internal functions to take std::string_view

This commit is contained in:
Henrik Rydgård
2026-02-06 12:31:49 +01:00
parent c85496c84d
commit f8077347e4
7 changed files with 24 additions and 33 deletions
+2 -9
View File
@@ -236,19 +236,12 @@ void VirtualDiscFileSystem::DoState(PointerWrap &p)
// We don't savestate handlers (loaded on fs load), but if they change, it may not load properly.
}
Path VirtualDiscFileSystem::GetLocalPath(std::string localpath) const {
Path VirtualDiscFileSystem::GetLocalPath(std::string_view localpath) const {
if (localpath.empty())
return basePath;
if (localpath[0] == '/')
localpath.erase(0,1);
//Convert slashes
#ifdef _WIN32
for (size_t i = 0; i < localpath.size(); i++) {
if (localpath[i] == '/')
localpath[i] = '\\';
}
#endif
localpath.remove_prefix(1);
return basePath / localpath;
}