forked from OSchip/llvm-project
[clang] NFC: Use range-based for loop
This commit is contained in:
parent
269baa7bfc
commit
c57ca33547
|
@ -2033,10 +2033,8 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
|
|||
SmallVector<StringRef, 2> Best;
|
||||
unsigned BestEditDistance = (std::numeric_limits<unsigned>::max)();
|
||||
|
||||
for (clang::Module::submodule_iterator J = Module->submodule_begin(),
|
||||
JEnd = Module->submodule_end();
|
||||
J != JEnd; ++J) {
|
||||
unsigned ED = Name.edit_distance((*J)->Name,
|
||||
for (class Module *SubModule : Module->submodules()) {
|
||||
unsigned ED = Name.edit_distance(SubModule->Name,
|
||||
/*AllowReplacements=*/true,
|
||||
BestEditDistance);
|
||||
if (ED <= BestEditDistance) {
|
||||
|
@ -2045,7 +2043,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
|
|||
BestEditDistance = ED;
|
||||
}
|
||||
|
||||
Best.push_back((*J)->Name);
|
||||
Best.push_back(SubModule->Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue