From 0964903e2c19132a86716ec270da64361191c871 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Fri, 29 Jan 2016 21:23:47 +0000 Subject: [PATCH] Use range for loop git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259243 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ProfileData/InstrProfTest.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/unittests/ProfileData/InstrProfTest.cpp b/unittests/ProfileData/InstrProfTest.cpp index ddf13de1ffe..f2a3bceab47 100644 --- a/unittests/ProfileData/InstrProfTest.cpp +++ b/unittests/ProfileData/InstrProfTest.cpp @@ -755,18 +755,16 @@ TEST_F(InstrProfTest, instr_prof_symtab_compression_test) { FuncNames2.push_back(OS.str()); } - for (int DoCompression = 0; DoCompression < 2; DoCompression++) { + for (bool DoCompression : {false, true}) { // Compressing: std::string FuncNameStrings1; - collectPGOFuncNameStrings(FuncNames1, - (DoCompression != 0 && zlib::isAvailable()), - FuncNameStrings1); + collectPGOFuncNameStrings( + FuncNames1, (DoCompression && zlib::isAvailable()), FuncNameStrings1); // Compressing: std::string FuncNameStrings2; - collectPGOFuncNameStrings(FuncNames2, - (DoCompression != 0 && zlib::isAvailable()), - FuncNameStrings2); + collectPGOFuncNameStrings( + FuncNames2, (DoCompression && zlib::isAvailable()), FuncNameStrings2); for (int Padding = 0; Padding < 3; Padding++) { // Join with paddings: