]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Improve name of LocalStorage::increment_level_2_counters
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 18 Aug 2023 19:30:33 +0000 (21:30 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 28 Aug 2023 19:01:00 +0000 (21:01 +0200)
(cherry picked from commit 0df72d6809f188cd294f95ddd5c18f2ffc5f96eb)

src/storage/local/LocalStorage.cpp
src/storage/local/LocalStorage.hpp

index 988155961d2f3bf048381d9bf2afa41e8c960888..b2dfbb84505f9bcd2cd3852a171ec8e478c7eb4c 100644 (file)
@@ -446,7 +446,7 @@ LocalStorage::put(const Digest& key,
   int64_t size_change_kibibyte =
     Util::size_change_kibibyte(cache_file.stat, new_stat);
   auto counters =
-    increment_level_2_counters(key, files_change, size_change_kibibyte);
+    increment_files_and_size_counters(key, files_change, size_change_kibibyte);
 
   l2_content_lock.release();
 
@@ -485,7 +485,7 @@ LocalStorage::remove(const Digest& key, const core::CacheEntryType type)
   }
 
   LOG("Removed {} from local storage ({})", key.to_string(), cache_file.path);
-  increment_level_2_counters(
+  increment_files_and_size_counters(
     key, -1, -static_cast<int64_t>(cache_file.stat.size_on_disk() / 1024));
 }
 
@@ -943,9 +943,9 @@ LocalStorage::recount_level_1_dir(util::LongLivedLockFileManager& lock_manager,
 }
 
 std::optional<core::StatisticsCounters>
-LocalStorage::increment_level_2_counters(const Digest& key,
-                                         int64_t files,
-                                         int64_t size_kibibyte)
+LocalStorage::increment_files_and_size_counters(const Digest& key,
+                                                int64_t files,
+                                                int64_t size_kibibyte)
 {
   uint8_t l1_index = key.bytes()[0] >> 4;
   uint8_t l2_index = key.bytes()[0] & 0xF;
index 29f8a028f94b8790d03ef618adb248e5635cec85..7b72c5f8d1256390cef11deab2cb3f8228966510 100644 (file)
@@ -151,7 +151,7 @@ private:
   void recount_level_1_dir(util::LongLivedLockFileManager& lock_manager,
                            uint8_t l1_index);
 
-  std::optional<core::StatisticsCounters> increment_level_2_counters(
+  std::optional<core::StatisticsCounters> increment_files_and_size_counters(
     const Digest& key, int64_t files, int64_t size_kibibyte);
 
   void perform_automatic_cleanup();