Skip to content

Commit f8358fe

Browse files
committed
remove _arguments_isequal
1 parent 3ba3ba9 commit f8358fe

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

NDTensors/src/lib/SymmetrySectors/src/sector_product.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ function sym_arguments_maybe_insert_unspecified(s1, s2)
6868
arguments_maybe_insert_unspecified(s2, s1)
6969
end
7070

71-
function arguments_isequal(s1, s2)
72-
isempty(s1) && return _arguments_isequal(empty(s2), s2)
73-
isempty(s2) && return _arguments_isequal(s1, empty(s1))
74-
return _arguments_isequal(s1, s2)
71+
function make_empty_match(a1, b1)
72+
a2 = isempty(a1) ? empty(b1) : a1
73+
b2 = isempty(b1) ? empty(a2) : b1
74+
return a2, b2
7575
end
7676

77-
function _arguments_isequal(s1, s2)
78-
return ==(sym_arguments_maybe_insert_unspecified(s1, s2)...)
77+
function arguments_isequal(a1, b1)
78+
return ==(sym_arguments_maybe_insert_unspecified(make_empty_match(a1, b1)...)...)
7979
end
8080

8181
function arguments_product(s1, s2)
@@ -85,9 +85,7 @@ function arguments_product(s1, s2)
8585
end
8686

8787
function arguments_isless(a1, b1)
88-
a2 = isempty(a1) ? empty(b1) : a1
89-
b2 = isempty(b1) ? empty(a2) : b1
90-
return isless(sym_arguments_maybe_insert_unspecified(a2, b2)...)
88+
return isless(sym_arguments_maybe_insert_unspecified(make_empty_match(a1, b1)...)...)
9189
end
9290

9391
# ================================= Cartesian Product ====================================

0 commit comments

Comments
 (0)