[llvm] r259243 - Use range for loop
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 13:23:48 PST 2016
Author: davidxl
Date: Fri Jan 29 15:23:47 2016
New Revision: 259243
URL: http://llvm.org/viewvc/llvm-project?rev=259243&view=rev
Log:
Use range for loop
Modified:
llvm/trunk/unittests/ProfileData/InstrProfTest.cpp
Modified: llvm/trunk/unittests/ProfileData/InstrProfTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ProfileData/InstrProfTest.cpp?rev=259243&r1=259242&r2=259243&view=diff
==============================================================================
--- llvm/trunk/unittests/ProfileData/InstrProfTest.cpp (original)
+++ llvm/trunk/unittests/ProfileData/InstrProfTest.cpp Fri Jan 29 15:23:47 2016
@@ -755,18 +755,16 @@ TEST_F(InstrProfTest, instr_prof_symtab_
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:
More information about the llvm-commits
mailing list