use unordered_map instead of vector

This commit is contained in:
AzuLX 2026-01-09 19:22:00 +00:00
parent 1533cc3e84
commit 604ce89673
No known key found for this signature in database
GPG Key ID: BED7E7DC23A637BC
3 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ namespace GleeBug
{ {
//check if this address had a breakpoint that was recently deleted //check if this address had a breakpoint that was recently deleted
auto& deletedBps = mProcess->recentlyDeletedSwbp; auto& deletedBps = mProcess->recentlyDeletedSwbp;
auto foundIt = std::find(deletedBps.begin(), deletedBps.end(), exceptionAddress); auto foundIt = deletedBps.find(exceptionAddress);
if(foundIt != deletedBps.end() && mThread) if(foundIt != deletedBps.end() && mThread)
{ {
Registers(mThread->hThread, CONTEXT_CONTROL).Gip = exceptionAddress; Registers(mThread->hThread, CONTEXT_CONTROL).Gip = exceptionAddress;

View File

@ -68,7 +68,7 @@ namespace GleeBug
return false; return false;
FlushInstructionCache(hProcess, nullptr, 0); FlushInstructionCache(hProcess, nullptr, 0);
recentlyDeletedSwbp.push_back(address); recentlyDeletedSwbp.insert(address);
//remove the breakpoint from the maps //remove the breakpoint from the maps
softwareBreakpointReferences.erase(info.address); softwareBreakpointReferences.erase(info.address);

View File

@ -32,7 +32,7 @@ namespace GleeBug
MemoryBreakpointSet memoryBreakpointRanges; MemoryBreakpointSet memoryBreakpointRanges;
MemoryBreakpointMap memoryBreakpointPages; MemoryBreakpointMap memoryBreakpointPages;
std::vector<ptr> recentlyDeletedSwbp; std::unordered_set<ptr> recentlyDeletedSwbp;
/** /**
\brief Constructor. \brief Constructor.