]> granicus.if.org Git - clang/commitdiff
Use range-based for loop to avoid the need for calculating an array size. NFC
authorCraig Topper <craig.topper@gmail.com>
Mon, 30 Nov 2015 03:11:12 +0000 (03:11 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 30 Nov 2015 03:11:12 +0000 (03:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254282 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFG.cpp

index cff15cb3fd8034f13c398782a6f21a93bdab4144..ed2239f88ae5eedab44c570516f3cbe375c6dbf5 100644 (file)
@@ -825,10 +825,7 @@ private:
     // * Variable x is equal to the largest literal.
     // * Variable x is greater than largest literal.
     bool AlwaysTrue = true, AlwaysFalse = true;
-    for (unsigned int ValueIndex = 0;
-         ValueIndex < sizeof(Values) / sizeof(Values[0]);
-         ++ValueIndex) {
-      llvm::APSInt Value = Values[ValueIndex];
+    for (llvm::APSInt Value : Values) {
       TryResult Res1, Res2;
       Res1 = analyzeLogicOperatorCondition(BO1, Value, L1);
       Res2 = analyzeLogicOperatorCondition(BO2, Value, L2);