]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Enable Clang-Tidy performance-no-automatic-move check
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 18 May 2022 18:53:02 +0000 (20:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 23 May 2022 17:16:29 +0000 (19:16 +0200)
src/.clang-tidy
src/storage/Storage.cpp
src/storage/primary/PrimaryStorage.cpp

index 803b4f5632a34d374c795b8bb49edc1b6968a833..c14120d1ab7ba3e213329b241b883c99a738c359 100644 (file)
@@ -17,7 +17,6 @@ Checks:          '-*,
                   -readability-qualified-auto,
                   -readability-redundant-declaration,
                   performance-*,
-                  -performance-no-automatic-move,
                   -performance-unnecessary-value-param,
                   modernize-*,
                   -modernize-avoid-c-arrays,
index 02dd573cb075c0d5e0afb5188d5b5be85d9e397b..957c71aaccc7ce55f142705a06f569fe3a5520ba 100644 (file)
@@ -232,7 +232,7 @@ Storage::get(const Digest& key, const core::CacheEntryType type)
 {
   MTR_SCOPE("storage", "get");
 
-  const auto path = primary.get(key, type);
+  auto path = primary.get(key, type);
   primary.increment_statistic(path ? core::Statistic::primary_storage_hit
                                    : core::Statistic::primary_storage_miss);
   if (path) {
index 6c048f352d9fe5250f14a6ca5727f6073d26eaeb..0a6a2997dbb4104585319a9139168fe9082c3d75 100644 (file)
@@ -353,10 +353,9 @@ PrimaryStorage::update_stats_and_maybe_move_cache_file(
 
   const auto stats_file =
     FMT("{}/{}/stats", m_config.cache_dir(), level_string);
-  const auto counters =
-    StatsFile(stats_file).update([&counter_updates](auto& cs) {
-      cs.increment(counter_updates);
-    });
+  auto counters = StatsFile(stats_file).update([&counter_updates](auto& cs) {
+    cs.increment(counter_updates);
+  });
   if (!counters) {
     return std::nullopt;
   }