mirror of
https://github.com/august-alt/gpui.git
synced 2025-03-14 12:58:39 +03:00
style: use std::remove_if
instead of for
This commit is contained in:
parent
4f3967daec
commit
e2f160e7ce
@ -113,16 +113,11 @@ QMap<std::string, QString> loadListFromRegistry(AbstractRegistrySource &source,
|
||||
std::vector<std::string> valueNames = source.getValueNames(key);
|
||||
|
||||
// finding and erase **delvals.
|
||||
for (auto it = valueNames.begin(); it != valueNames.end(); ++it) {
|
||||
if (QString::fromStdString(*it).compare("**delvals.", Qt::CaseInsensitive) == 0) {
|
||||
it = valueNames.erase(it);
|
||||
|
||||
// std::vecotor<T>::erase() returning iterator that pointing
|
||||
// to the next element after erased
|
||||
--it;
|
||||
break;
|
||||
}
|
||||
}
|
||||
valueNames.erase(std::remove_if(valueNames.begin(), valueNames.end(),
|
||||
[](const std::string& name) {
|
||||
return QString::fromStdString(name).compare("**delvals.", Qt::CaseInsensitive) == 0;
|
||||
}),
|
||||
valueNames.end());
|
||||
|
||||
for (auto &valueName : valueNames) {
|
||||
items[valueName] =
|
||||
|
Loading…
x
Reference in New Issue
Block a user