diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2021-11-12 12:11:15 +0100 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2021-11-12 12:13:12 +0100 |
commit | c57ca335474704cabeafcd8421600c3c7ccc4484 (patch) | |
tree | c4733cf1da404baf153518c0fcf61d53133bac0f /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 269baa7bfcf8e42b576ff29a56b8d56c1e7d39eb (diff) | |
download | llvm-c57ca335474704cabeafcd8421600c3c7ccc4484.zip llvm-c57ca335474704cabeafcd8421600c3c7ccc4484.tar.gz llvm-c57ca335474704cabeafcd8421600c3c7ccc4484.tar.bz2 |
[clang] NFC: Use range-based for loop
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 41cc446..ee62d70 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -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); } } |