From a8da035566fe87af0a526dcf00a48ac11957d63e Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 1 Feb 2025 11:33:30 -0600 Subject: [PATCH] Warnings provider clang-tidy fixes --- .../scwx/provider/warnings_provider.hpp | 7 ++--- .../scwx/provider/warnings_provider.cpp | 26 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/wxdata/include/scwx/provider/warnings_provider.hpp b/wxdata/include/scwx/provider/warnings_provider.hpp index 140b671f..0d14d258 100644 --- a/wxdata/include/scwx/provider/warnings_provider.hpp +++ b/wxdata/include/scwx/provider/warnings_provider.hpp @@ -2,9 +2,7 @@ #include -namespace scwx -{ -namespace provider +namespace scwx::provider { /** @@ -30,5 +28,4 @@ private: std::unique_ptr p; }; -} // namespace provider -} // namespace scwx +} // namespace scwx::provider diff --git a/wxdata/source/scwx/provider/warnings_provider.cpp b/wxdata/source/scwx/provider/warnings_provider.cpp index d506fc5c..a6b1a37d 100644 --- a/wxdata/source/scwx/provider/warnings_provider.cpp +++ b/wxdata/source/scwx/provider/warnings_provider.cpp @@ -29,9 +29,7 @@ # pragma warning(pop) #endif -namespace scwx -{ -namespace provider +namespace scwx::provider { static const std::string logPrefix_ = "scwx::provider::warnings_provider"; @@ -42,9 +40,9 @@ class WarningsProvider::Impl public: struct FileInfoRecord { - FileInfoRecord(const std::string& contentLength, - const std::string& lastModified) : - contentLengthStr_ {contentLength}, lastModifiedStr_ {lastModified} + FileInfoRecord(std::string contentLength, std::string lastModified) : + contentLengthStr_ {std::move(contentLength)}, + lastModifiedStr_ {std::move(lastModified)} { } @@ -54,12 +52,16 @@ public: using WarningFileMap = std::map; - explicit Impl(const std::string& baseUrl) : - baseUrl_ {baseUrl}, files_ {}, filesMutex_ {} + explicit Impl(std::string baseUrl) : + baseUrl_ {std::move(baseUrl)}, files_ {}, filesMutex_ {} { } - ~Impl() {} + ~Impl() = default; + Impl(const Impl&) = delete; + Impl& operator=(const Impl&) = delete; + Impl(const Impl&&) = delete; + Impl& operator=(const Impl&&) = delete; bool UpdateFileRecord(const cpr::Response& response, const std::string& filename); @@ -87,8 +89,7 @@ WarningsProvider::LoadUpdatedFiles( using namespace std::chrono; #if (__cpp_lib_chrono >= 201907L) - namespace date = std::chrono; - namespace df = std; + namespace df = std; #else using namespace date; namespace df = date; @@ -251,5 +252,4 @@ bool WarningsProvider::Impl::UpdateFileRecord(const cpr::Response& response, return updated; } -} // namespace provider -} // namespace scwx +} // namespace scwx::provider