]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Use LocalStorage::get_stats_file
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 18 Aug 2023 19:29:14 +0000 (21:29 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 18 Aug 2023 19:29:14 +0000 (21:29 +0200)
src/storage/local/LocalStorage.cpp

index febe68426002725c1f139dce81ddc1f98b342bc5..5ca81de23d1a85d0b4541507884847890cd43cba 100644 (file)
@@ -442,11 +442,8 @@ LocalStorage::finalize()
     // Pseudo-randomly choose one of the stats files in the 256 level 2
     // directories.
     const auto bucket = getpid() % 256;
-    const auto stats_file =
-      FMT("{}/{:x}/{:x}/stats", m_config.cache_dir(), bucket / 16, bucket % 16);
-    StatsFile(stats_file).update([&](auto& cs) {
-      cs.increment(m_counter_updates);
-    });
+    const auto stats_file = get_stats_file(bucket / 16, bucket % 16);
+    stats_file.update([&](auto& cs) { cs.increment(m_counter_updates); });
 
     if (m_stored_data) {
       perform_automatic_cleanup();