Skip to content

Commit 2f29788

Browse files
committed
MB-67589: Fix MSVC warning C4459 [6/6]...
Fix the remaining issues where local variables hides global ones Change-Id: I9c2809e3ea785684523e11037b451e610b6c3cf0 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/236005 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Jim Walker <jim@couchbase.com>
1 parent eaab73f commit 2f29788

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

engines/ep/benchmarks/probabilistic_counter_bench.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
static const double incFactor = 0.012;
2929

3030
ProbabilisticCounter<uint8_t> probabilisticCounter(incFactor);
31-
uint8_t counter{100}; // 100 is an arbitrary value between 0 and 255
31+
uint8_t benchmarkCounter{100}; // 100 is an arbitrary value between 0 and 255
3232

3333
static void BM_SaturateCounter(benchmark::State& state) {
3434
while (state.KeepRunning()) {
3535
// benchmark generateValue
36-
benchmark::DoNotOptimize(probabilisticCounter.generateValue(counter));
36+
benchmark::DoNotOptimize(
37+
probabilisticCounter.generateValue(benchmarkCounter));
3738
}
3839
}
3940

engines/ep/src/ep_parameters.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ static const std::unordered_set<std::string_view> vbucketParamSet{
181181
};
182182

183183
static const std::unordered_set<std::string_view> allParamSet = []() {
184-
std::unordered_set<std::string_view> allParamSet;
185-
allParamSet.insert(checkpointParamSet.begin(), checkpointParamSet.end());
186-
allParamSet.insert(flushParamSet.begin(), flushParamSet.end());
187-
allParamSet.insert(dcpParamSet.begin(), dcpParamSet.end());
188-
allParamSet.insert(vbucketParamSet.begin(), vbucketParamSet.end());
189-
return allParamSet;
184+
std::unordered_set<std::string_view> ret;
185+
ret.insert(checkpointParamSet.begin(), checkpointParamSet.end());
186+
ret.insert(flushParamSet.begin(), flushParamSet.end());
187+
ret.insert(dcpParamSet.begin(), dcpParamSet.end());
188+
ret.insert(vbucketParamSet.begin(), vbucketParamSet.end());
189+
return ret;
190190
}();
191191

192192
bool checkSetParameterCategory(std::string_view key,

0 commit comments

Comments
 (0)