From bbc85a5f22b0cf4a63cf0f68ecdba16c518e6b64 Mon Sep 17 00:00:00 2001 From: sdong Date: Mon, 19 Jul 2021 17:07:18 -0700 Subject: [PATCH] Fix minor wrong variable name in db_bench (#8549) Summary: Fix a minor variable name that is not accurate. This is recently introduced in https://github.com/facebook/rocksdb/pull/7818 Pull Request resolved: https://github.com/facebook/rocksdb/pull/8549 Reviewed By: zhichao-cao Differential Revision: D29745585 fbshipit-source-id: 6268b348878fdf99a162b2cc3d5876fbd9bb10d9 --- tools/db_bench_tool.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 2af9ccb71..d959e84bf 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -6234,18 +6234,19 @@ class Benchmark { } // Pick a Iterator to use - size_t cf_to_use = (db_.db == nullptr) - ? (size_t{thread->rand.Next()} % multi_dbs_.size()) - : 0; + size_t db_idx_to_use = + (db_.db == nullptr) + ? (size_t{thread->rand.Next()} % multi_dbs_.size()) + : 0; std::unique_ptr single_iter; Iterator* iter_to_use; if (FLAGS_use_tailing_iterator) { - iter_to_use = tailing_iters[cf_to_use]; + iter_to_use = tailing_iters[db_idx_to_use]; } else { if (db_.db != nullptr) { single_iter.reset(db_.db->NewIterator(options)); } else { - single_iter.reset(multi_dbs_[cf_to_use].db->NewIterator(options)); + single_iter.reset(multi_dbs_[db_idx_to_use].db->NewIterator(options)); } iter_to_use = single_iter.get(); }