Add an unordered_map to TreeEntry for faster lookup

This commit is contained in:
KentuckyCompass committed 2015-09-07 17:39:17 -07:00
1 parent 481eac7184
commit 3f36b476ad
2 files changed
+18 -13

No files matched your search

+7 -1
View File
@@ -19,6 +19,7 @@
#include <map>
#include <list>
#include <unordered_map>
#include "FileSystem.h"
@@ -68,7 +69,12 @@ private:
bool isDirectory;
TreeEntry *parent;
std::vector<TreeEntry*> children;
// slow lookup, in PSP-accurate sorting order
std::vector<TreeEntry *> children;
// fast lookup, in undefined order
std::unordered_map<std::string, TreeEntry *> fastChildren;
};
struct OpenFileEntry