Remove copy of pairs from the for range loop (#6514)

Summary:
Remove copy of pairs from the for range loop
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6514

Test Plan: make check

Differential Revision: D20389688

Pulled By: cheng-chang

fbshipit-source-id: 1c772091f955be33267514010f3596c61a6f46b5
main
Cheng Chang 5 years ago committed by Facebook GitHub Bot
parent 2d9efc9ab2
commit 6dea7530b5
  1. 6
      options/options_parser.cc

@ -416,7 +416,7 @@ Status RocksDBOptionsParser::EndSection(
return s; return s;
} }
} else if (section == kOptionSectionVersion) { } else if (section == kOptionSectionVersion) {
for (const auto pair : opt_map) { for (const auto& pair : opt_map) {
if (pair.first == "rocksdb_version") { if (pair.first == "rocksdb_version") {
s = ParseVersionNumber(pair.first, pair.second, 3, db_version); s = ParseVersionNumber(pair.first, pair.second, 3, db_version);
if (!s.ok()) { if (!s.ok()) {
@ -739,7 +739,7 @@ Status RocksDBOptionsParser::VerifyDBOptions(
const DBOptions& base_opt, const DBOptions& persisted_opt, const DBOptions& base_opt, const DBOptions& persisted_opt,
const std::unordered_map<std::string, std::string>* /*opt_map*/, const std::unordered_map<std::string, std::string>* /*opt_map*/,
OptionsSanityCheckLevel sanity_check_level) { OptionsSanityCheckLevel sanity_check_level) {
for (auto pair : db_options_type_info) { for (const auto& pair : db_options_type_info) {
if (pair.second.verification == OptionVerificationType::kDeprecated) { if (pair.second.verification == OptionVerificationType::kDeprecated) {
// We skip checking deprecated variables as they might // We skip checking deprecated variables as they might
// contain random values since they might not be initialized // contain random values since they might not be initialized
@ -777,7 +777,7 @@ Status RocksDBOptionsParser::VerifyCFOptions(
const ColumnFamilyOptions& persisted_opt, const ColumnFamilyOptions& persisted_opt,
const std::unordered_map<std::string, std::string>* persisted_opt_map, const std::unordered_map<std::string, std::string>* persisted_opt_map,
OptionsSanityCheckLevel sanity_check_level) { OptionsSanityCheckLevel sanity_check_level) {
for (auto& pair : cf_options_type_info) { for (const auto& pair : cf_options_type_info) {
if (pair.second.verification == OptionVerificationType::kDeprecated) { if (pair.second.verification == OptionVerificationType::kDeprecated) {
// We skip checking deprecated variables as they might // We skip checking deprecated variables as they might
// contain random values since they might not be initialized // contain random values since they might not be initialized

Loading…
Cancel
Save