Skip to content

Commit 52e86f1

Browse files
authored
Merge pull request #298 from JuliaSymbolics/s/hash-ord
don't rely on isless to be defined on elements, use hash as fallback
2 parents c3081cd + 8e5d0a6 commit 52e86f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ordering.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function <ₑ(a, b)
1313
if !istree(a) && !istree(b)
1414
T = typeof(a)
1515
S = typeof(b)
16-
return T===S ? isless(a, b) : nameof(T) < nameof(S)
16+
return T===S ? (T <: Number ? isless(a, b) : hash(a) < hash(b)) : nameof(T) < nameof(S)
1717
elseif istree(b) && !istree(a)
1818
return true
1919
elseif istree(a) && istree(b)

0 commit comments

Comments
 (0)