Преглед изворни кода

apt-cache: stats: Average is over used, not all, buckets

It does not make sense to consider empty buckets in the
average, as they do not affect the lookup performance.
Julian Andres Klode пре 10 година
родитељ
комит
6d7fc45ed4
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      cmdline/apt-cache.cc

+ 1 - 1
cmdline/apt-cache.cc

@@ -172,7 +172,7 @@ static void ShowHashTableStats(std::string Type,
    cout << "Total buckets in " << Type << ": " << NumBuckets << std::endl;
    cout << "  Unused: " << UnusedBuckets << std::endl;
    cout << "  Used: " << UsedBuckets  << std::endl;
-   cout << "  Average entries: " << Entries/(double)NumBuckets << std::endl;
+   cout << "  Average entries: " << Entries/(double)UsedBuckets << std::endl;
    cout << "  Longest: " << LongestBucket << std::endl;
    cout << "  Shortest: " << ShortestBucket << std::endl;
 }