Fix term matching strategy bugs

This commit is contained in:
Loïc Lecrenier
2023-03-30 14:01:52 +02:00
parent 35c16ad047
commit d48cdc67a0
3 changed files with 7 additions and 8 deletions

View File

@ -300,14 +300,14 @@ impl QueryGraph {
}
};
let mut nodes_to_remove = BTreeMap::<u16, SmallBitmap<QueryNode>>::new();
for (node_id, node) in self.nodes.iter() {
'outer: for (node_id, node) in self.nodes.iter() {
let QueryNodeData::Term(t) = &node.data else { continue };
let mut cost = 0;
for id in t.term_ids.clone() {
if let Some(t_cost) = cost_of_term_idx(id) {
cost += t_cost;
cost = std::cmp::max(cost, t_cost);
} else {
continue;
continue 'outer;
}
}
nodes_to_remove