]> 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>
Fri, 18 Aug 2023 19:30:33 +0000 (21:30 +0200)
src/storage/local/LocalStorage.cpp
src/storage/local/LocalStorage.hpp

index 5ca81de23d1a85d0b4541507884847890cd43cba..53a2704b47f158e27e867f37d074504bd195ef98 100644 (file)
@@ -541,7 +541,7 @@ LocalStorage::put(const Hash::Digest& key,
   int64_t size_change_kibibyte =
     kibibyte_size_diff(cache_file.dir_entry, new_dir_entry);
   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();
 
@@ -582,7 +582,7 @@ LocalStorage::remove(const Hash::Digest& key, const core::CacheEntryType type)
   LOG("Removed {} from local storage ({})",
       util::format_digest(key),
       cache_file.path);
-  increment_level_2_counters(
+  increment_files_and_size_counters(
     key, -1, -static_cast<int64_t>(cache_file.dir_entry.size_on_disk() / 1024));
 }
 
@@ -1085,9 +1085,9 @@ LocalStorage::recount_level_1_dir(util::LongLivedLockFileManager& lock_manager,
 }
 
 std::optional<core::StatisticsCounters>
-LocalStorage::increment_level_2_counters(const Hash::Digest& key,
-                                         int64_t files,
-                                         int64_t size_kibibyte)
+LocalStorage::increment_files_and_size_counters(const Hash::Digest& key,
+                                                int64_t files,
+                                                int64_t size_kibibyte)
 {
   uint8_t l1_index = key[0] >> 4;
   uint8_t l2_index = key[0] & 0xF;
index 0fe89e725368b58a53a84d0fff0c911a734d78e2..9a5af32b8731bf6b3c0431b887c96951dc12d87c 100644 (file)
@@ -160,7 +160,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 Hash::Digest& key, int64_t files, int64_t size_kibibyte);
 
   void perform_automatic_cleanup();