]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Fix conditions for --show-stats
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 12 Dec 2022 13:33:26 +0000 (14:33 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 13 Dec 2022 19:38:38 +0000 (20:38 +0100)
src/core/Statistics.cpp

index 662b59ba37a34431996865ec0ccd00120f0d2a88..98a7623103cb628b6eefda4a95076adfb18ad81d 100644 (file)
@@ -314,7 +314,9 @@ Statistics::format_human_readable(const Config& config,
   const uint64_t remote_errors = S(remote_storage_error);
   const uint64_t remote_timeouts = S(remote_storage_timeout);
 
-  table.add_heading("Local storage:");
+  if (!from_log || verbosity > 0 || (local_hits + local_misses) > 0) {
+    table.add_heading("Local storage:");
+  }
   if (!from_log) {
     std::vector<C> size_cells{
       "  Cache size (GB):",
@@ -342,7 +344,7 @@ Statistics::format_human_readable(const Config& config,
       table.add_row({"  Cleanups:", cleanups});
     }
   }
-  if (verbosity > 0 || (remote_hits + remote_misses) > 0) {
+  if (verbosity > 0 || (local_hits + local_misses) > 0) {
     add_ratio_row(table, "  Hits:", local_hits, local_hits + local_misses);
     add_ratio_row(table, "  Misses:", local_misses, local_hits + local_misses);
   }