summaryrefslogtreecommitdiff
path: root/autofeur_db
diff options
context:
space:
mode:
authorMatthieu Pignolet <matthieu@matthieu-dev.xyz>2024-06-06 14:21:03 +0400
committerMatthieu Pignolet <matthieu@matthieu-dev.xyz>2024-06-06 14:21:03 +0400
commitddac41968707f6f5bc4c6529247d871b046b5e5c (patch)
tree9fdf1e13322f681d102c93830446b0c4a0c530e2 /autofeur_db
parent7698cd57a9db15aaf5d2f13affb001b4832033a4 (diff)
make the bot reply less often
Diffstat (limited to 'autofeur_db')
-rw-r--r--autofeur_db/src/trie.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/autofeur_db/src/trie.rs b/autofeur_db/src/trie.rs
index 1788d52..2359d2d 100644
--- a/autofeur_db/src/trie.rs
+++ b/autofeur_db/src/trie.rs
@@ -109,14 +109,14 @@ impl<'a> Trie<'a> {
while current_node.child_nodes.len() != 0 {
// We need to choose a random child based on weights
let weighted = WeightedIndex::new(current_node.child_nodes.iter().map(|(_, node)| {
- (node.child_count
+ node.child_count
/ (node
.child_nodes
.iter()
.map(|(_, b)| b.child_count)
.sum::<u64>()
+ 1)
- + 1)
+ + 1
}))
.expect("distribution creation should be valid");