Skip to content

Commit e71d9e0

Browse files
committed
compare operations directly
1 parent d57b285 commit e71d9e0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ordering.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,22 @@ end
4646

4747
<(a::Sym, b::Sym) = a.name < b.name
4848

49+
<(a::Function, b::Function) = nameof(a) <nameof(b)
50+
4951
function cmp_term_term(a, b)
5052
la = arglength(a)
5153
lb = arglength(b)
5254

5355
if la == 0 && lb == 0
54-
return nameof(operation(a)) <nameof(operation(b))
56+
return operation(a) <operation(b)
5557
elseif la === 0
5658
return operation(a) <ₑ b
5759
elseif lb === 0
5860
return a <operation(b)
5961
end
6062

61-
na = nameof(operation(a))
62-
nb = nameof(operation(b))
63+
na = operation(a)
64+
nb = operation(b)
6365

6466
if 0 < arglength(a) <= 2 && 0 < arglength(b) <= 2
6567
# e.g. a < sin(a) < b ^ 2 < b

0 commit comments

Comments
 (0)