mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
CheatSearch: Use index range for ClonePartial
Specify the begin and end indices instead of filling a vector with all the indices which are continuous anyway.
This commit is contained in:
@ -373,28 +373,15 @@ void CheatSearchWidget::OnNextScanClicked()
|
||||
|
||||
bool CheatSearchWidget::RefreshValues()
|
||||
{
|
||||
const size_t result_count = m_session->GetResultCount();
|
||||
if (result_count == 0)
|
||||
const size_t displayed_result_count = std::min(TABLE_MAX_ROWS, m_session->GetResultCount());
|
||||
if (displayed_result_count == 0)
|
||||
{
|
||||
m_info_label_1->setText(tr("Cannot refresh without results."));
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool too_many_results = result_count > TABLE_MAX_ROWS;
|
||||
std::unique_ptr<Cheats::CheatSearchSessionBase> tmp;
|
||||
if (too_many_results)
|
||||
{
|
||||
std::vector<size_t> value_indices;
|
||||
value_indices.reserve(TABLE_MAX_ROWS);
|
||||
for (size_t i = 0; i < TABLE_MAX_ROWS; ++i)
|
||||
value_indices.push_back(i);
|
||||
tmp = m_session->ClonePartial(value_indices);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = m_session->Clone();
|
||||
}
|
||||
|
||||
std::unique_ptr<Cheats::CheatSearchSessionBase> tmp =
|
||||
m_session->ClonePartial(0, displayed_result_count);
|
||||
tmp->SetFilterType(Cheats::FilterType::DoNotFilter);
|
||||
|
||||
const Cheats::SearchErrorCode error_code = [&tmp] {
|
||||
|
Reference in New Issue
Block a user