mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Filesystem: Add a cache for finding file info by disc offset
FileMonitor calls this every time a read happens, and there's no code that only calls this a small number of times, so having a cache is worthwhile.
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@ -101,9 +102,10 @@ private:
|
||||
u32 m_offset_shift;
|
||||
std::vector<u8> m_file_system_table;
|
||||
FileInfoGCWii m_root;
|
||||
// Maps the end offset of files to FST indexes
|
||||
mutable std::map<u64, u32> m_offset_file_info_cache;
|
||||
|
||||
std::unique_ptr<FileInfo> FindFileInfo(const std::string& path, const FileInfo& file_info) const;
|
||||
std::unique_ptr<FileInfo> FindFileInfo(u64 disc_offset, const FileInfo& file_info) const;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user