Skip to content

Commit

Permalink
Use TrixiBase.walkexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
efaulhaber committed Feb 6, 2024
1 parent cefc5e3 commit dc6c48b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/auxiliary/special_elixirs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ end

# Helper methods used in the functions defined above

# Apply the function `f` to `expr` and all sub-expressions recursively.
walkexpr(f, expr::Expr) = f(Expr(expr.head, (walkexpr(f, arg) for arg in expr.args)...))
walkexpr(f, x) = f(x)

# Find a (keyword or common) assignment to `destination` in `expr`
# and return the assigned value.
function find_assignment(expr, destination)
Expand All @@ -137,7 +133,7 @@ function find_assignment(expr, destination)
found = false

# find explicit and keyword assignments
walkexpr(expr) do x
TrixiBase.walkexpr(expr) do x
if x isa Expr
if (x.head === Symbol("=") || x.head === :kw) &&
x.args[1] === Symbol(destination)
Expand Down

0 comments on commit dc6c48b

Please sign in to comment.