Skip to content

Commit

Permalink
Merge pull request #32 from TrevorHansen/om14
Browse files Browse the repository at this point in the history
Fix faster-greedy-dag extractor.
  • Loading branch information
oflatt authored Jan 1, 2024
2 parents 4c377b7 + b9c1228 commit 80d9c63
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/extract/faster_greedy_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ impl FasterGreedyDagExtractor {
best_cost: Cost,
) -> CostSet {
let node = &egraph[&node_id];
let cid = egraph.nid_to_cid(&node_id);

// No children -> easy.
if node.children.is_empty() {
return CostSet {
costs: Default::default(),
costs: HashMap::from([(cid.clone(), node.cost)]),
total: node.cost,
choice: node_id.clone(),
};
Expand All @@ -41,8 +41,6 @@ impl FasterGreedyDagExtractor {
childrens_classes.sort();
childrens_classes.dedup();

let cid = egraph.nid_to_cid(&node_id);

let first_cost = costs.get(&childrens_classes[0]).unwrap();

if childrens_classes.contains(cid)
Expand Down

0 comments on commit 80d9c63

Please sign in to comment.