From 72eb15f2820fd40f694ac5fdf40beddc1e292f26 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 30 May 2014 09:46:13 -0700 Subject: [PATCH] Speed up debug build hashfunc lookup. --- Core/MIPS/MIPSAnalyst.cpp | 10 +++++----- Core/MIPS/MIPSAnalyst.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 942e22ca3e..5e13526247 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -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; } diff --git a/Core/MIPS/MIPSAnalyst.h b/Core/MIPS/MIPSAnalyst.h index ab908f213d..bb25de880f 100644 --- a/Core/MIPS/MIPSAnalyst.h +++ b/Core/MIPS/MIPSAnalyst.h @@ -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();