From: Craig Topper Date: Mon, 30 Nov 2015 03:11:12 +0000 (+0000) Subject: Use range-based for loop to avoid the need for calculating an array size. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c64147ff0ff60667f106dd47dae789f417f941e8;p=clang Use range-based for loop to avoid the need for calculating an array size. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254282 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index cff15cb3fd..ed2239f88a 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -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);