summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorChris Mumford <cmumford@google.com>2019-05-06 10:51:11 -0700
committerChris Mumford <cmumford@google.com>2019-05-06 10:52:16 -0700
commit142035edd4b1ab431c0ecbd547d4a77f1eca0667 (patch)
tree36377d2cc7d182acc49cb3efd672daa93d8a970b /benchmarks
parente22b1cec6e1e0e2dec4c93b658acbfc56fb692c0 (diff)
downloadleveldb-142035edd4b1ab431c0ecbd547d4a77f1eca0667.tar.gz
Initialize Stats::start_ before first use in Stats::Start().
Avoids a use before initialization error. This fixes issue #676. PiperOrigin-RevId: 246855204
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/db_bench.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/benchmarks/db_bench.cc b/benchmarks/db_bench.cc
index 3090b43..3696023 100644
--- a/benchmarks/db_bench.cc
+++ b/benchmarks/db_bench.cc
@@ -187,14 +187,12 @@ class Stats {
void Start() {
next_report_ = 100;
- last_op_finish_ = start_;
hist_.Clear();
done_ = 0;
bytes_ = 0;
seconds_ = 0;
- start_ = g_env->NowMicros();
- finish_ = start_;
message_.clear();
+ start_ = finish_ = last_op_finish_ = g_env->NowMicros();
}
void Merge(const Stats& other) {