diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index 0ff52440bf..877bcb79ab 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -297,11 +297,6 @@ void ISOFileSystem::ReadDirectory(u32 startsector, u32 dirsize, TreeEntry *root, root->children.push_back(e); } } - - root->fastChildren.reserve(root->children.size()); - for (TreeEntry *e : root->children) { - root->fastChildren[e->name] = e; - } } ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(const std::string &path, bool catchError) @@ -338,14 +333,20 @@ ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(const std::string &path, bo nextSlashIndex = pathLength; const std::string firstPathComponent = path.substr(pathIndex, nextSlashIndex - pathIndex); - auto child = e->fastChildren.find(firstPathComponent); - if (child != e->fastChildren.end()) { - //yay we got it - ne = child->second; - name = child->first; + for (size_t i = 0; i < e->children.size(); i++) + { + const std::string &n = e->children[i]->name; + + if (firstPathComponent == n) + { + //yay we got it + ne = e->children[i]; + name = n; + break; + } } } - + if (ne) { e = ne; diff --git a/Core/FileSystems/ISOFileSystem.h b/Core/FileSystems/ISOFileSystem.h index b9d7cceb0d..6cf3366a40 100644 --- a/Core/FileSystems/ISOFileSystem.h +++ b/Core/FileSystems/ISOFileSystem.h @@ -19,7 +19,6 @@ #include #include -#include #include "FileSystem.h" @@ -69,12 +68,7 @@ private: bool isDirectory; TreeEntry *parent; - - // slow lookup, in PSP-accurate sorting order std::vector children; - - // fast lookup, in undefined order - std::unordered_map fastChildren; }; struct OpenFileEntry