diff --git a/.travis.yml b/.travis.yml index 992bf48acd6..32cec9b3586 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: focal language: cpp os: - linux @@ -6,9 +6,7 @@ os: compiler: - clang - gcc -osx_image: xcode8.3 -jdk: - - openjdk7 +osx_image: xcode12 cache: - ccache - apt @@ -19,7 +17,7 @@ addons: - ubuntu-toolchain-r-test packages: - curl - - g++-8 + - g++-9 - libbz2-dev - libgflags-dev - libsnappy-dev @@ -50,13 +48,16 @@ matrix: - os: osx env: TEST_GROUP=4 - os: osx - env: TEST_GROUP=platform_dependent + env: JOB_NAME=lite_build + - os: osx + env: JOB_NAME=examples + - os: osx + env: JOB_NAME=encrypted_env - os : linux compiler: clang - os: osx compiler: gcc - - os: osx - env: JOB_NAME=encrypted_env + # https://docs.travis-ci.com/user/caching/#ccache-cache install: diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index c6eac1768df..ea5f9b15070 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -1055,7 +1055,7 @@ Status DBImpl::CompactFilesImpl( } if (output_file_names != nullptr) { - for (const auto newf : c->edit()->GetNewFiles()) { + for (const auto& newf : c->edit()->GetNewFiles()) { (*output_file_names) .push_back(TableFileName(c->immutable_cf_options()->cf_paths, newf.second.fd.GetNumber(), @@ -1147,7 +1147,7 @@ void DBImpl::NotifyOnCompactionBegin(ColumnFamilyData* cfd, Compaction* c, } } } - for (const auto newf : c->edit()->GetNewFiles()) { + for (const auto& newf : c->edit()->GetNewFiles()) { info.output_files.push_back(TableFileName( c->immutable_cf_options()->cf_paths, newf.second.fd.GetNumber(), newf.second.fd.GetPathId())); diff --git a/db/db_options_test.cc b/db/db_options_test.cc index 19b42347f2a..9a856587425 100644 --- a/db/db_options_test.cc +++ b/db/db_options_test.cc @@ -37,7 +37,7 @@ class DBOptionsTest : public DBTestBase { std::unordered_map options_map; StringToMap(options_str, &options_map); std::unordered_map mutable_map; - for (const auto opt : db_options_type_info) { + for (const auto& opt : db_options_type_info) { if (opt.second.is_mutable && opt.second.verification != OptionVerificationType::kDeprecated) { mutable_map[opt.first] = options_map[opt.first]; @@ -53,7 +53,7 @@ class DBOptionsTest : public DBTestBase { std::unordered_map options_map; StringToMap(options_str, &options_map); std::unordered_map mutable_map; - for (const auto opt : cf_options_type_info) { + for (const auto& opt : cf_options_type_info) { if (opt.second.is_mutable && opt.second.verification != OptionVerificationType::kDeprecated) { mutable_map[opt.first] = options_map[opt.first]; diff --git a/options/options_parser.cc b/options/options_parser.cc index d5b0c25a32e..07bbf056582 100644 --- a/options/options_parser.cc +++ b/options/options_parser.cc @@ -409,7 +409,7 @@ Status RocksDBOptionsParser::EndSection( return s; } } else if (section == kOptionSectionVersion) { - for (const auto pair : opt_map) { + for (const auto& pair : opt_map) { if (pair.first == "rocksdb_version") { s = ParseVersionNumber(pair.first, pair.second, 3, db_version); if (!s.ok()) { diff --git a/table/table_test.cc b/table/table_test.cc index 6cd26bc732a..6ac27a99c30 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -226,7 +226,7 @@ class BlockConstructor: public Constructor { block_ = nullptr; BlockBuilder builder(table_options.block_restart_interval); - for (const auto kv : kv_map) { + for (const auto& kv : kv_map) { builder.Add(kv.first, kv.second); } // Open the block @@ -349,7 +349,7 @@ class TableConstructor: public Constructor { TablePropertiesCollectorFactory::Context::kUnknownColumnFamily, file_writer_.get())); - for (const auto kv : kv_map) { + for (const auto& kv : kv_map) { if (convert_to_internal_key_) { ParsedInternalKey ikey(kv.first, kMaxSequenceNumber, kTypeValue); std::string encoded; @@ -482,7 +482,7 @@ class MemTableConstructor: public Constructor { kMaxSequenceNumber, 0 /* column_family_id */); memtable_->Ref(); int seq = 1; - for (const auto kv : kv_map) { + for (const auto& kv : kv_map) { memtable_->Add(seq, kTypeValue, kv.first, kv.second); seq++; } @@ -543,7 +543,7 @@ class DBConstructor: public Constructor { delete db_; db_ = nullptr; NewDB(); - for (const auto kv : kv_map) { + for (const auto& kv : kv_map) { WriteBatch batch; batch.Put(kv.first, kv.second); EXPECT_TRUE(db_->Write(WriteOptions(), &batch).ok()); diff --git a/tools/ldb_cmd_test.cc b/tools/ldb_cmd_test.cc index 24622b7ccf3..995313a9a38 100644 --- a/tools/ldb_cmd_test.cc +++ b/tools/ldb_cmd_test.cc @@ -39,7 +39,7 @@ TEST_F(LdbCmdTest, HexToStringBadInputs) { const vector badInputs = { "0xZZ", "123", "0xx5", "0x111G", "0x123", "Ox12", "0xT", "0x1Q1", }; - for (const auto badInput : badInputs) { + for (const auto& badInput : badInputs) { try { rocksdb::LDBCommand::HexToString(badInput); std::cerr << "Should fail on bad hex value: " << badInput << "\n";