From 1a5eee170c6480ba842d718e7dfd47f2a2c84384 Mon Sep 17 00:00:00 2001 From: Davi de Castro Reis Date: Tue, 14 Jun 2011 03:30:41 -0300 Subject: [PATCH] Fixed bug in uit64 benchmark. --- cxxmph/bm_common.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cxxmph/bm_common.cc b/cxxmph/bm_common.cc index f0e0336..c52b2e5 100644 --- a/cxxmph/bm_common.cc +++ b/cxxmph/bm_common.cc @@ -54,7 +54,8 @@ bool SearchUint64Benchmark::SetUp() { if (!Uint64Benchmark::SetUp()) return false; random_.resize(nsearches_); for (int i = 0; i < nsearches_; ++i) { - random_.push_back(values_[random() % values_.size()]); + uint32_t pos = random() % values_.size(); + random_[i] = values_[pos]; } return true; }