]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Avoid const data members
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 21 Oct 2024 18:34:54 +0000 (20:34 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 22 Oct 2024 16:43:34 +0000 (18:43 +0200)
C++ Core Guidelines C.12

src/ccache/core/statistics.cpp
src/ccache/storage/remote/httpstorage.cpp
src/ccache/storage/remote/redisstorage.cpp

index 61951d13c3ee981ef71500a0b43d59e9fed41879..2eb786dc1ecd52eb8e50adcf9f0f2915d5d3ad34 100644 (file)
@@ -52,10 +52,10 @@ struct StatisticsField
   {
   }
 
-  const Statistic statistic;
-  const char* const id;          // for --print-stats
-  const char* const description; // for --show-stats --verbose
-  const unsigned flags;          // bitmask of FLAG_* values
+  Statistic statistic;
+  const char* id;          // for --print-stats
+  const char* description; // for --show-stats --verbose
+  unsigned flags;          // bitmask of FLAG_* values
 };
 
 } // namespace
index d51e9404dc0ea87fdeb0165f1c7b3cb71feef79a..605fef155cc5064d07a3e06f81da2e7457a3fa5c 100644 (file)
@@ -56,7 +56,7 @@ public:
 private:
   enum class Layout { bazel, flat, subdirs };
 
-  const std::string m_url_path;
+  std::string m_url_path;
   httplib::Client m_http_client;
   Layout m_layout = Layout::subdirs;
 
index a199a26b2ca828ac3e83a03f63661ecca7f75b44..f7be7e2472ca7077848ad7d3c10f0064968de5a5 100644 (file)
@@ -78,7 +78,7 @@ public:
   tl::expected<bool, Failure> remove(const Hash::Digest& key) override;
 
 private:
-  const std::string m_prefix;
+  std::string m_prefix;
   RedisContext m_context;
 
   void