From: Joel Rosdahl Date: Wed, 18 May 2022 18:53:02 +0000 (+0200) Subject: build: Enable Clang-Tidy performance-no-automatic-move check X-Git-Tag: v4.7~227 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c84ac9bea5e6ca4ff6671f2abc6b51ced144b82;p=thirdparty%2Fccache.git build: Enable Clang-Tidy performance-no-automatic-move check --- diff --git a/src/.clang-tidy b/src/.clang-tidy index 803b4f563..c14120d1a 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -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, diff --git a/src/storage/Storage.cpp b/src/storage/Storage.cpp index 02dd573cb..957c71aac 100644 --- a/src/storage/Storage.cpp +++ b/src/storage/Storage.cpp @@ -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) { diff --git a/src/storage/primary/PrimaryStorage.cpp b/src/storage/primary/PrimaryStorage.cpp index 6c048f352..0a6a2997d 100644 --- a/src/storage/primary/PrimaryStorage.cpp +++ b/src/storage/primary/PrimaryStorage.cpp @@ -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; }