소스 검색

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;
 }