Skip to content

Commit

Permalink
Move statement into bidirection conditional as it is only required fo…
Browse files Browse the repository at this point in the history
…r bidirectional rules
  • Loading branch information
gkronber committed Sep 10, 2024
1 parent 4cb1dc6 commit cd064e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EGraphs/saturation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ function eqsat_search!(
@debug "$rule is banned"
continue
end
ids_left = cached_ids(g, rule.left)
ids_right = is_bidirectional(rule) ? cached_ids(g, rule.right) : UNDEF_ID_VEC

ids_left = cached_ids(g, rule.left)
for i in ids_left
cansearch(scheduler, rule_idx, i) || continue
n_matches += rule.ematcher_left!(g, rule_idx, i, rule.stack, ematch_buffer)
inform!(scheduler, rule_idx, i, n_matches)
end

if is_bidirectional(rule)
ids_right = cached_ids(g, rule.right)
for i in ids_right
cansearch(scheduler, rule_idx, i) || continue
n_matches += rule.ematcher_right!(g, rule_idx, i, rule.stack, ematch_buffer)
Expand Down

0 comments on commit cd064e6

Please sign in to comment.