mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 10:09:36 -06:00
Filesystem: Use file info in arguments instead of path
Some callers already have the file info, making the relatively slow FindFileInfo calls unnecessary. Callers that didn't have the file info will now need to call FindFileInfo on their own.
This commit is contained in:
@ -88,18 +88,19 @@ void Log(u64 offset, const DiscIO::Partition& partition)
|
||||
if (!s_filesystem)
|
||||
return;
|
||||
|
||||
const std::string path = s_filesystem->GetPath(offset);
|
||||
const DiscIO::FileInfo* file_info = s_filesystem->FindFileInfo(offset);
|
||||
|
||||
// Do nothing if no file was found at that offset
|
||||
if (path.empty())
|
||||
if (!file_info)
|
||||
return;
|
||||
|
||||
const std::string path = s_filesystem->GetPath(file_info->GetOffset());
|
||||
|
||||
// Do nothing if we found the same file again
|
||||
if (s_previous_file == path)
|
||||
return;
|
||||
|
||||
const u64 size = s_filesystem->GetFileSize(path);
|
||||
const std::string size_string = ThousandSeparate(size / 1000, 7);
|
||||
const std::string size_string = ThousandSeparate(file_info->GetSize() / 1000, 7);
|
||||
|
||||
const std::string log_string = StringFromFormat("%s kB %s", size_string.c_str(), path.c_str());
|
||||
if (IsSoundFile(path))
|
||||
|
Reference in New Issue
Block a user