diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-04-10 16:51:14 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-04-10 17:00:45 -0700 |
| commit | bc7b11517fa198f569bb01f178116e70d68e31a4 (patch) | |
| tree | c6813577a257509eed8f88e5f8e397d5cf3313cf /Source/Core | |
| parent | 69aca2fbfc88d08a17d36c03d51dd698eb9cce1b (diff) | |
MenuBar: Optimize SearchInstruction
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/MenuBar.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp index 73b00aca61..01280cacf4 100644 --- a/Source/Core/DolphinQt/MenuBar.cpp +++ b/Source/Core/DolphinQt/MenuBar.cpp @@ -1774,20 +1774,19 @@ void MenuBar::SearchInstruction() auto& system = Core::System::GetInstance(); auto& memory = system.GetMemory(); - Core::CPUThreadGuard guard(system); + const std::string op_std = op.toStdString(); + const Core::CPUThreadGuard guard(system); bool found = false; for (u32 addr = Memory::MEM1_BASE_ADDR; addr < Memory::MEM1_BASE_ADDR + memory.GetRamSizeReal(); addr += 4) { - const auto ins_name = QString::fromStdString( - PPCTables::GetInstructionName(PowerPC::MMU::HostRead_U32(guard, addr), addr)); - if (op == ins_name) + if (op_std == PPCTables::GetInstructionName(PowerPC::MMU::HostRead_U32(guard, addr), addr)) { - NOTICE_LOG_FMT(POWERPC, "Found {} at {:08x}", op.toStdString(), addr); + NOTICE_LOG_FMT(POWERPC, "Found {} at {:08x}", op_std, addr); found = true; } } if (!found) - NOTICE_LOG_FMT(POWERPC, "Opcode {} not found", op.toStdString()); + NOTICE_LOG_FMT(POWERPC, "Opcode {} not found", op_std); } |
