浏览代码

fix hashfull calculation

Nicolas Winkler 2 年之前
父节点
当前提交
bf4223bfcd
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/ttable.rs

+ 2 - 2
src/ttable.rs

@@ -170,10 +170,10 @@ impl Cache {
         }
     }
 
-    pub fn fullness_permill(&self) -> usize{
+    pub fn fullness_permill(&self) -> usize {
         let mut permill = 0;
         for i in 0..25 {
-            permill += 10 * self.table[i].hashes.iter().filter(|h| **h == 0).count();
+            permill += 10 * self.table[i].hashes.iter().filter(|h| **h != 0).count();
         }
         permill
     }