[clang] b9c2b60 - Avoid else-if after return, NFC

Jun Zhang via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 27 08:19:29 PDT 2022


Author: Jun Zhang
Date: 2022-08-27T23:14:48+08:00
New Revision: b9c2b6069ea7f3d253d88725c1993da463f39575

URL: https://github.com/llvm/llvm-project/commit/b9c2b6069ea7f3d253d88725c1993da463f39575
DIFF: https://github.com/llvm/llvm-project/commit/b9c2b6069ea7f3d253d88725c1993da463f39575.diff

LOG: Avoid else-if after return, NFC

Signed-off-by: Jun Zhang <jun at junz.org>

Added: 
    

Modified: 
    clang/lib/Basic/SourceManager.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 38545d1be918f..24e4aefd53f1c 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -1795,11 +1795,11 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache,
         if (Entry.getFile().NumCreatedFIDs)
           ID += Entry.getFile().NumCreatedFIDs - 1 /*because of next ++ID*/;
         continue;
-      } else if (IncludeLoc.isValid()) {
-        // If file was included but not from FID, there is no more files/macros
-        // that may be "contained" in this file.
-        return;
       }
+      // If file was included but not from FID, there is no more files/macros
+      // that may be "contained" in this file.
+      if (IncludeLoc.isValid())
+        return;
       continue;
     }
 


        


More information about the cfe-commits mailing list