modernized `erase()` calls (#4530)

This commit is contained in:
Oliver Stöneberg 2022-10-02 07:13:31 +02:00 committed by GitHub
parent cff1cd9cda
commit ee124cd097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -1257,7 +1257,7 @@ void CheckClass::privateFunctions()
// Check virtual functions // Check virtual functions
for (std::list<const Function*>::iterator it = privateFuncs.begin(); it != privateFuncs.end();) { for (std::list<const Function*>::iterator it = privateFuncs.begin(); it != privateFuncs.end();) {
if ((*it)->isImplicitlyVirtual(true)) // Give true as default value to be returned if we don't see all base classes if ((*it)->isImplicitlyVirtual(true)) // Give true as default value to be returned if we don't see all base classes
privateFuncs.erase(it++); it = privateFuncs.erase(it);
else else
++it; ++it;
} }

View File

@ -674,7 +674,7 @@ Scope *clangimport::AstNode::createScope(TokenList *tokenList, Scope::ScopeType
std::list<Variable> &varlist = const_cast<Scope *>(def->scope())->varlist; std::list<Variable> &varlist = const_cast<Scope *>(def->scope())->varlist;
for (std::list<Variable>::iterator var = varlist.begin(); var != varlist.end();) { for (std::list<Variable>::iterator var = varlist.begin(); var != varlist.end();) {
if (replaceVar.find(&(*var)) != replaceVar.end()) if (replaceVar.find(&(*var)) != replaceVar.end())
varlist.erase(var++); var = varlist.erase(var);
else else
++var; ++var;
} }

View File

@ -69,7 +69,7 @@ void ImportProject::ignorePaths(const std::vector<std::string> &ipaths)
} }
} }
if (ignore) if (ignore)
fileSettings.erase(it++); it = fileSettings.erase(it);
else else
++it; ++it;
} }
@ -79,7 +79,7 @@ void ImportProject::ignoreOtherConfigs(const std::string &cfg)
{ {
for (std::list<FileSettings>::iterator it = fileSettings.begin(); it != fileSettings.end();) { for (std::list<FileSettings>::iterator it = fileSettings.begin(); it != fileSettings.end();) {
if (it->cfg != cfg) if (it->cfg != cfg)
fileSettings.erase(it++); it = fileSettings.erase(it);
else else
++it; ++it;
} }

View File

@ -3330,7 +3330,7 @@ void TemplateSimplifier::replaceTemplateUsage(
std::list<TokenAndName>::iterator ti; std::list<TokenAndName>::iterator ti;
for (ti = mTemplateInstantiations.begin(); ti != mTemplateInstantiations.end();) { for (ti = mTemplateInstantiations.begin(); ti != mTemplateInstantiations.end();) {
if (ti->token() == tok) { if (ti->token() == tok) {
mTemplateInstantiations.erase(ti++); ti = mTemplateInstantiations.erase(ti);
break; break;
} else { } else {
++ti; ++ti;

View File

@ -63,7 +63,7 @@ private:
for (std::map<std::string, std::size_t>::iterator i = files.begin(); i != files.end();) { for (std::map<std::string, std::size_t>::iterator i = files.begin(); i != files.end();) {
if (i->first.compare(0,2,"./") == 0) { if (i->first.compare(0,2,"./") == 0) {
files[i->first.substr(2)] = i->second; files[i->first.substr(2)] = i->second;
files.erase(i++); i = files.erase(i);
} else } else
++i; ++i;
} }