diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-04-12 23:25:03 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-04-13 00:19:01 -0700 |
| commit | 672be6a8cf6d511ea260e7b055241f476fce0045 (patch) | |
| tree | d60c455d5d1e9f182463f5c4bd047b6a2e1dd152 /Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | |
| parent | 1bfeeb8a631bf3ad3d357b3c920ca8e8a456344e (diff) | |
PPCSymbolDB: GetDescription by std::string_view
Should save a lot of deep copies.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index 26d6d0e053..e33fbde2fa 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -38,6 +38,7 @@ #include "DolphinQt/Debugger/AssembleInstructionDialog.h" #include "DolphinQt/Debugger/PatchInstructionDialog.h" #include "DolphinQt/Host.h" +#include "DolphinQt/QtUtils/FromStdString.h" #include "DolphinQt/QtUtils/SetWindowDecorations.h" #include "DolphinQt/Resources.h" #include "DolphinQt/Settings.h" @@ -326,7 +327,7 @@ void CodeViewWidget::Update(const Core::CPUThreadGuard* guard) std::string ins = (split == std::string::npos ? disas : disas.substr(0, split)); std::string param = (split == std::string::npos ? "" : disas.substr(split + 1)); - std::string desc = debug_interface.GetDescription(addr); + const std::string_view desc = debug_interface.GetDescription(addr); // Adds whitespace and a minimum size to ins and param. Helps to prevent frequent resizing while // scrolling. @@ -334,7 +335,7 @@ void CodeViewWidget::Update(const Core::CPUThreadGuard* guard) QStringLiteral("%1").arg(QString::fromStdString(ins), -7, QLatin1Char(' ')); const QString param_formatted = QStringLiteral("%1").arg(QString::fromStdString(param), -19, QLatin1Char(' ')); - const QString desc_formatted = QStringLiteral("%1 ").arg(QString::fromStdString(desc)); + const QString desc_formatted = QStringLiteral("%1 ").arg(QtUtils::FromStdString(desc)); auto* ins_item = new QTableWidgetItem(ins_formatted); auto* param_item = new QTableWidgetItem(param_formatted); @@ -374,7 +375,7 @@ void CodeViewWidget::Update(const Core::CPUThreadGuard* guard) branch.is_link = IsBranchInstructionWithLink(ins); description_item->setText( - tr("--> %1").arg(QString::fromStdString(debug_interface.GetDescription(branch_addr)))); + tr("--> %1").arg(QtUtils::FromStdString(debug_interface.GetDescription(branch_addr)))); param_item->setForeground(dark_theme ? QColor(255, 135, 255) : Qt::magenta); } |
