BranchWatchProxyModel: Avoid String Copies In filterAcceptsRow

This commit is contained in:
mitaclaw 2024-05-24 17:05:14 -07:00
parent 47fae68b0f
commit 7dc0bdd5df
1 changed files with 4 additions and 4 deletions

View File

@ -141,15 +141,15 @@ bool BranchWatchProxyModel::filterAcceptsRow(int source_row, const QModelIndex&)
if (!m_origin_symbol_name.isEmpty())
{
if (const QVariant& symbol_name_v = sourceModel()->GetSymbolList()[source_row].origin_name;
!symbol_name_v.isValid() ||
!symbol_name_v.value<QString>().contains(m_origin_symbol_name, Qt::CaseInsensitive))
!symbol_name_v.isValid() || !static_cast<const QString*>(symbol_name_v.data())
->contains(m_origin_symbol_name, Qt::CaseInsensitive))
return false;
}
if (!m_destin_symbol_name.isEmpty())
{
if (const QVariant& symbol_name_v = sourceModel()->GetSymbolList()[source_row].destin_name;
!symbol_name_v.isValid() ||
!symbol_name_v.value<QString>().contains(m_destin_symbol_name, Qt::CaseInsensitive))
!symbol_name_v.isValid() || !static_cast<const QString*>(symbol_name_v.data())
->contains(m_destin_symbol_name, Qt::CaseInsensitive))
return false;
}
return true;