From d6066f190c373e42c337dc530dc51d7ff18bbfbd Mon Sep 17 00:00:00 2001 From: Nitch2024 Date: Sun, 30 Mar 2025 11:51:13 -0700 Subject: [PATCH] Addressing feedback from the PR 1. using fmt::format instead of std 2. naming convention text_code instead of textCode 3. Removed temporary scope for CPUThreadGuard --- .../Core/DolphinQt/Debugger/CodeViewWidget.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index de082a289f..f1b05b5821 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -831,25 +831,23 @@ void CodeViewWidget::OnCopyWholeLine() { const u32 addr = GetContextAddress(); - const std::string textCode = [this, addr] { - Core::CPUThreadGuard guard(m_system); - return m_system.GetPowerPC().GetDebugInterface().Disassemble(&guard, addr); - }(); + Core::CPUThreadGuard guard(m_system); - std::string wholeLineText = std::format("{:08x} {}", addr, textCode); + std::string text_code = m_system.GetPowerPC().GetDebugInterface().Disassemble(&guard, addr); + std::string whole_line = fmt::format("{:08x} {}", addr, text_code); - if (IsInstructionLoadStore(textCode)) + if (IsInstructionLoadStore(text_code)) { const std::optional target_addr = - m_system.GetPowerPC().GetDebugInterface().GetMemoryAddressFromInstruction(textCode); + m_system.GetPowerPC().GetDebugInterface().GetMemoryAddressFromInstruction(text_code); if (target_addr) { - wholeLineText += std::format(" targetting {:08x}", *target_addr); + whole_line += fmt::format(" targetting {:08x}", *target_addr); } } - QApplication::clipboard()->setText(QString::fromStdString(wholeLineText)); + QApplication::clipboard()->setText(QString::fromStdString(whole_line)); } void CodeViewWidget::OnCopyFunction()