Skip to content

Commit fbcc627

Browse files
committed
modernize some things with std::erase_if
1 parent 03a61e3 commit fbcc627

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gui/qt/debugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ void MainWindow::gotoPressed() {
19891989
disasmUpdateAddr(hex2int(resolved), false);
19901990

19911991
auto &hist = m_disasmGotoHistory;
1992-
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());
1992+
std::erase_if(hist, [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; });
19931993
hist.insert(hist.begin(), typed);
19941994
if (hist.size() > 50) { hist.resize(50); }
19951995
} else {

gui/qt/memorywidget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void MainWindow::flashGotoPressed() {
117117
ui->flashEdit->setOffset(hex2int(resolved));
118118

119119
auto &hist = m_memGotoHistory;
120-
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());
120+
std::erase_if(hist, [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; });
121121
hist.insert(hist.begin(), typed);
122122
if (hist.size() > 50) { hist.resize(50); }
123123
} else {
@@ -138,7 +138,7 @@ void MainWindow::ramGotoPressed() {
138138
ui->ramEdit->setOffset(hex2int(resolved) - 0xD00000);
139139

140140
auto &hist = m_memGotoHistory;
141-
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());
141+
std::erase_if(hist, [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; });
142142
hist.insert(hist.begin(), typed);
143143
if (hist.size() > 50) { hist.resize(50); }
144144
} else {
@@ -225,7 +225,7 @@ void MainWindow::memGotoEdit(HexWidget *edit) {
225225
memGoto(edit, static_cast<uint32_t>(hex2int(resolved)));
226226
// MRU update
227227
auto &hist = m_memGotoHistory;
228-
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());
228+
std::erase_if(hist, [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; });
229229
hist.insert(hist.begin(), typed);
230230
if (hist.size() > 50) { hist.resize(50); }
231231
} else {

0 commit comments

Comments
 (0)