Skip to content

Commit

Permalink
Efficiency improvement in fullac matching: don't bother permute argum…
Browse files Browse the repository at this point in the history
…ents if the head doesn't match.
  • Loading branch information
zengmao committed Aug 29, 2024
1 parent 596ad9c commit a14a308
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/matchers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ function term_matcher(term, fullac_flag = false)
data_arg_perms = permutations(args)
result = nothing
T = symtype(data)
if op != operation(term)
return nothing
end
for perm in data_arg_perms
data_permuted = Term{T}(op, perm)
result = loop(data_permuted, bindings, matchers) # Try to eat exactly one term
Expand Down

0 comments on commit a14a308

Please sign in to comment.