diff --git a/src/types.jl b/src/types.jl index 3abf6c139..9668aa8dd 100644 --- a/src/types.jl +++ b/src/types.jl @@ -116,25 +116,15 @@ end @inline head(x::BasicSymbolic) = operation(x) +""" +$(TYPEDSIGNATURES) + +Returns the arguments of `x` without sorting them. + +This function must be defined if `iscall(x)` is `true`. +""" function arguments(x::BasicSymbolic) args = unsorted_arguments(x) - @compactified x::BasicSymbolic begin - Add => @goto ADD - Mul => @goto MUL - _ => return args - end - @label MUL - if !x.issorted[] - sort!(args, by=get_degrees) - x.issorted[] = true - end - return args - - @label ADD - if !x.issorted[] - sort!(args, lt = monomial_lt, by=get_degrees) - x.issorted[] = true - end return args end