]> granicus.if.org Git - clang/commitdiff
[preprocessor] Minor optimization following r178671.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 3 Apr 2013 21:29:07 +0000 (21:29 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 3 Apr 2013 21:29:07 +0000 (21:29 +0000)
Don't bother looking for parameter index of 'B' token if 'A' is not a parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178699 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/MacroInfo.cpp

index 5abafe1cb76d22ab935d2bf01c92b3e9f403052e..b61ff71d1767f4c2ebe9c0d589cabff0990fbd22 100644 (file)
@@ -110,8 +110,9 @@ bool MacroInfo::isIdenticalTo(const MacroInfo &Other, Preprocessor &PP,
       // With syntactic equivalence the parameter names can be different as long
       // as they are used in the same place.
       int AArgNum = getArgumentNum(A.getIdentifierInfo());
-      int BArgNum = Other.getArgumentNum(B.getIdentifierInfo());
-      if (AArgNum == -1 || AArgNum != BArgNum)
+      if (AArgNum == -1)
+        return false;
+      if (AArgNum != Other.getArgumentNum(B.getIdentifierInfo()))
         return false;
       continue;
     }