diff --git a/db/arena_wrapped_db_iter.h b/db/arena_wrapped_db_iter.h index cdf9046a9..3442440c1 100644 --- a/db/arena_wrapped_db_iter.h +++ b/db/arena_wrapped_db_iter.h @@ -34,7 +34,7 @@ class Version; // the same as the inner DBIter. class ArenaWrappedDBIter : public Iterator { public: - virtual ~ArenaWrappedDBIter() { + ~ArenaWrappedDBIter() override { if (db_iter_ != nullptr) { db_iter_->~DBIter(); } else { diff --git a/db/kv_checksum.h b/db/kv_checksum.h index 196c6f7c9..bfec80b51 100644 --- a/db/kv_checksum.h +++ b/db/kv_checksum.h @@ -117,7 +117,7 @@ class ProtectionInfoKVO { friend class ProtectionInfoKVOS; friend class ProtectionInfoKVOC; - ProtectionInfoKVO(T val) : info_(val) { + explicit ProtectionInfoKVO(T val) : info_(val) { static_assert(sizeof(ProtectionInfoKVO) == sizeof(T), ""); } @@ -155,7 +155,7 @@ class ProtectionInfoKVOC { private: friend class ProtectionInfoKVO; - ProtectionInfoKVOC(T val) : kvo_(val) { + explicit ProtectionInfoKVOC(T val) : kvo_(val) { static_assert(sizeof(ProtectionInfoKVOC) == sizeof(T), ""); } @@ -193,7 +193,7 @@ class ProtectionInfoKVOS { private: friend class ProtectionInfoKVO; - ProtectionInfoKVOS(T val) : kvo_(val) { + explicit ProtectionInfoKVOS(T val) : kvo_(val) { static_assert(sizeof(ProtectionInfoKVOS) == sizeof(T), ""); } diff --git a/db/listener_test.cc b/db/listener_test.cc index ce53d297b..e3839fe77 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -1427,12 +1427,6 @@ TEST_F(EventListenerTest, BlobDBCompactFiles) { class BlobDBFileLevelEventListener : public EventListener { public: - BlobDBFileLevelEventListener() { - files_started_.store(0); - files_created_.store(0); - files_deleted_.store(0); - } - void OnBlobFileCreationStarted( const BlobFileCreationBriefInfo& info) override { files_started_++; @@ -1471,9 +1465,9 @@ class BlobDBFileLevelEventListener : public EventListener { } private: - std::atomic files_started_; - std::atomic files_created_; - std::atomic files_deleted_; + std::atomic files_started_{}; + std::atomic files_created_{}; + std::atomic files_deleted_{}; }; TEST_F(EventListenerTest, BlobDBFileTest) {