diff options
| author | JosJuice <josjuice@gmail.com> | 2015-07-29 16:42:29 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-06-13 22:38:31 +0200 |
| commit | 07d3a39aeb06204e13cfdf1d5f7dbe4f3aa66f89 (patch) | |
| tree | 5cb05fd42f2f5da5319d32a73cd2856ad5d18b61 /Source/Core/DiscIO/DiscScrubber.cpp | |
| parent | 5021b4a567fad9a258f2b0fc397912f499e4cb1d (diff) | |
Filesystem: Replace file info's full path with name
Some callers (i.e. ISOProperties) don't want the full path, so giving them
it is unnecessary. Those that do want it can use GetPathFromFSTOffset.
Not storing full paths everywhere also saves a small bit of RAM and is
necessary for a later commit. The code isn't especially pretty right now
(callers need to use FST offsets...) but it'll become better later.
Diffstat (limited to 'Source/Core/DiscIO/DiscScrubber.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DiscScrubber.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp index 70f9bed79a..71d1fa16bc 100644 --- a/Source/Core/DiscIO/DiscScrubber.cpp +++ b/Source/Core/DiscIO/DiscScrubber.cpp @@ -221,9 +221,12 @@ bool DiscScrubber::ParsePartitionData(const Partition& partition, PartitionHeade MarkAsUsedE(partition_data_offset, header->fst_offset, header->fst_size); // Go through the filesystem and mark entries as used - for (const FileInfoGCWii& file : filesystem->GetFileList()) + auto& file_list = filesystem->GetFileList(); + for (size_t i = 0; i < file_list.size(); ++i) { - DEBUG_LOG(DISCIO, "%s", file.m_FullPath.empty() ? "/" : file.m_FullPath.c_str()); + const std::string path = filesystem->GetPathFromFSTOffset(i); + DEBUG_LOG(DISCIO, "%s", path.empty() ? "/" : path.c_str()); + auto& file = file_list[i]; if (!file.IsDirectory()) MarkAsUsedE(partition_data_offset, file.GetOffset(), file.GetSize()); } |
