folly/experimental/test/BitsBenchmark.cpp: avoid -Wsign-compare error
authorJim Meyering <meyering@fb.com>
Tue, 6 Jan 2015 23:29:48 +0000 (15:29 -0800)
committerViswanath Sivakumar <viswanath@fb.com>
Tue, 13 Jan 2015 19:01:04 +0000 (11:01 -0800)
Summary:
* folly/experimental/test/BitsBenchmark.cpp (benchmarkSet):
Another s/int/size_t/ change to type of for-loop index, to match
the type of the loop's upper bound.

Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo

Reviewed By: davejwatson@fb.com

Subscribers: folly-diffs@

FB internal diff: D1767853

Tasks: 5941250

Signature: t1:1767853:1420587945:f32a0ef33f6c5fa75598ecb114a243f83b31e550

folly/experimental/test/BitsBenchmark.cpp

index 08230eac31b08f0c2b6cadec1834058e440f6bd4..379b71e0740c85b41024448bb31d989dd7ea4b6e 100644 (file)
@@ -44,7 +44,7 @@ void benchmarkSet(size_t n, T) {
     CHECK_LE(folly::findLastSet(max), size);
     CHECK_LE(folly::findLastSet(-min), size);
     std::uniform_int_distribution<T> dis(min, max);
-    for (int i = 0; i < k; ++i) {
+    for (size_t i = 0; i < k; ++i) {
       values[i] = dis(gen);
     }
   }