Skip to content

Commit 0023938

Browse files
committed
style: refactor slightly
1 parent 171bbaa commit 0023938

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Parse.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,7 @@ end
246246
Find an operator function by its name in the OperatorEnum, considering the arity.
247247
Throws appropriate errors for ambiguous or missing matches.
248248
"""
249-
@unstable function _find_operator_by_name(func_symbol, args, operators)
250-
function_name_offset = 1
251-
degree = length(args) - function_name_offset
252-
249+
@unstable function _find_operator_by_name(func_symbol, degree, operators)
253250
matches = Tuple{Function,Int}[]
254251

255252
for arity in 1:length(operators.ops)
@@ -314,7 +311,8 @@ module EmptyModule end
314311
Core.eval(EmptyModule, first(ex.args))
315312
catch
316313
# Try to find the function in operators by name
317-
_find_operator_by_name(first(ex.args), args, operators)
314+
degree = length(args) - 1
315+
_find_operator_by_name(first(ex.args), degree, operators)
318316
end::Function
319317
return _parse_expression(
320318
func, args, operators, variable_names, N, E, evaluate_on; kws...

0 commit comments

Comments
 (0)