Skip to content

Commit c10f540

Browse files
YingboMashashi
authored andcommitted
Optimized ordering computation
1 parent 5fe621f commit c10f540

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ordering.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
arglength(a) = length(arguments(a))
1212
function <(a, b)
13-
if !istree(a) && !istree(b)
13+
if a isa Term && (b isa Symbolic && !(b isa Term))
14+
return false
15+
elseif b isa Term && (a isa Symbolic && !(a isa Term))
16+
return true
17+
elseif !istree(a) && !istree(b)
1418
T = typeof(a)
1519
S = typeof(b)
1620
return T===S ? (T <: Number ? isless(a, b) : hash(a) < hash(b)) : nameof(T) < nameof(S)

0 commit comments

Comments
 (0)