r220014 - Switch to range-based for loop. No functionality change.

Richard Smith richard-llvm at metafoo.co.uk
Thu Oct 16 18:26:52 PDT 2014


Author: rsmith
Date: Thu Oct 16 20:26:52 2014
New Revision: 220014

URL: http://llvm.org/viewvc/llvm-project?rev=220014&view=rev
Log:
Switch to range-based for loop. No functionality change.

Modified:
    cfe/trunk/lib/Lex/HeaderSearch.cpp

Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=220014&r1=220013&r2=220014&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp Thu Oct 16 20:26:52 2014
@@ -575,15 +575,9 @@ const FileEntry *HeaderSearch::LookupFil
     // that they describe. These cannot be loaded lazily upon encountering a
     // header file, as there is no other known mapping from a header file to its
     // module map file.
-    for (llvm::SetVector<std::string>::iterator
-             I = HSOpts->ModuleMapFiles.begin(),
-             E = HSOpts->ModuleMapFiles.end();
-         I != E; ++I) {
-      const FileEntry *File = FileMgr.getFile(*I);
-      if (!File)
-        continue;
-      loadModuleMapFile(File, /*IsSystem=*/false);
-    }
+    for (const auto &Filename : HSOpts->ModuleMapFiles)
+      if (const FileEntry *File = FileMgr.getFile(Filename))
+        loadModuleMapFile(File, /*IsSystem=*/false);
     HSOpts->ModuleMapFiles.clear();
   }
 





More information about the cfe-commits mailing list