Speed up debug build hashfunc lookup.

This commit is contained in:
Unknown W. Brackets 2014-05-30 09:46:13 -07:00
parent c2778d9a2a
commit 72eb15f282
2 changed files with 6 additions and 6 deletions

View File

@ -978,11 +978,11 @@ skip:
}
}
const char *LookupHash(u64 hash, int funcsize) {
for (auto it = hashMap.begin(), end = hashMap.end(); it != end; ++it) {
if (it->hash == hash && (int)it->size == funcsize) {
return it->name;
}
const char *LookupHash(u64 hash, u32 funcsize) {
const HashMapFunc f = { "", hash, funcsize };
auto it = hashMap.find(f);
if (it != hashMap.end()) {
return it->name;
}
return 0;
}

View File

@ -110,7 +110,7 @@ namespace MIPSAnalyst
void LoadHashMap(std::string filename);
void StoreHashMap(std::string filename = "");
const char *LookupHash(u64 hash, int funcSize);
const char *LookupHash(u64 hash, u32 funcSize);
void ReplaceFunctions();
void UpdateHashMap();