aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/server.rs b/src/server.rs
index 14368e0..76911f6 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -382,10 +382,8 @@ where
}
counted += 1;
- // compensate twice for rare characters
- // - once to bring all chars to equal probability of sampling
- // - once to over-sample rare chars because we need to see them more
- let weight = 1f64 / (*f * *f) as f64;
+ // compensate for rare characters
+ let weight = 1f64 / (*f) as f64;
total_weight += weight;
let rand: f64 = rng.gen();
if rand < weight / total_weight {