PPCSymbolDB: GetDescription by std::string_view

Should save a lot of deep copies.
This commit is contained in:
mitaclaw
2024-04-12 23:25:03 -07:00
parent 1bfeeb8a63
commit 672be6a8cf
12 changed files with 49 additions and 29 deletions

View File

@ -193,11 +193,8 @@ void BreakpointWidget::Update()
m_table->setItem(i, 0, active);
m_table->setItem(i, 1, create_item(QStringLiteral("BP")));
if (ppc_symbol_db.GetSymbolFromAddr(bp.address))
{
m_table->setItem(
i, 2, create_item(QString::fromStdString(ppc_symbol_db.GetDescription(bp.address))));
}
if (const Common::Symbol* const symbol = ppc_symbol_db.GetSymbolFromAddr(bp.address))
m_table->setItem(i, 2, create_item(QString::fromStdString(symbol->name)));
m_table->setItem(i, 3,
create_item(QStringLiteral("%1").arg(bp.address, 8, 16, QLatin1Char('0'))));
@ -234,12 +231,8 @@ void BreakpointWidget::Update()
m_table->setItem(i, 0, active);
m_table->setItem(i, 1, create_item(QStringLiteral("MBP")));
if (ppc_symbol_db.GetSymbolFromAddr(mbp.start_address))
{
m_table->setItem(
i, 2,
create_item(QString::fromStdString(ppc_symbol_db.GetDescription(mbp.start_address))));
}
if (const Common::Symbol* const symbol = ppc_symbol_db.GetSymbolFromAddr(mbp.start_address))
m_table->setItem(i, 2, create_item(QString::fromStdString(symbol->name)));
if (mbp.is_ranged)
{