From cdd79d56b6fb6a1e732916ad1b4478fc5cc99450 Mon Sep 17 00:00:00 2001 From: Shinichi Umegane Date: Thu, 12 Dec 2024 14:37:24 +0900 Subject: [PATCH] cleanup for clang-tidy --- include/limestone/api/datastore.h | 2 +- src/limestone/rotation_result.cpp | 3 +-- src/limestone/rotation_result.h | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/limestone/api/datastore.h b/include/limestone/api/datastore.h index f028bfc..6eaefa5 100644 --- a/include/limestone/api/datastore.h +++ b/include/limestone/api/datastore.h @@ -77,7 +77,7 @@ class datastore { /** * @brief destruct the object */ - ~datastore() noexcept; + virtual ~datastore() noexcept; datastore(datastore const& other) = delete; datastore& operator=(datastore const& other) = delete; diff --git a/src/limestone/rotation_result.cpp b/src/limestone/rotation_result.cpp index d26a1b7..e346d2a 100644 --- a/src/limestone/rotation_result.cpp +++ b/src/limestone/rotation_result.cpp @@ -31,9 +31,8 @@ const std::set& rotation_result::get_rotation_end_files return rotation_end_files; } -void rotation_result::add_rotated_file(const std::string filename) { +void rotation_result::add_rotated_file(const std::string& filename) { latest_rotated_files_.insert(filename); - } } // namespace limestone::api diff --git a/src/limestone/rotation_result.h b/src/limestone/rotation_result.h index 910608e..43794ab 100644 --- a/src/limestone/rotation_result.h +++ b/src/limestone/rotation_result.h @@ -32,13 +32,13 @@ namespace limestone::api { class rotation_result { public: - rotation_result(epoch_id_type epoch) : epoch_id_(epoch) {} + explicit rotation_result(epoch_id_type epoch) : epoch_id_(epoch) {} [[nodiscard]] epoch_id_type get_epoch_id() const; [[nodiscard]] const std::set& get_rotation_end_files() const; void set_rotation_end_files(const std::set& files); + void add_rotated_file(const std::string& filename); - void add_rotated_file(std::string); private: // A set of filenames that were rotated in this rotation process. std::set latest_rotated_files_;