Skip to content

Commit 3ba3ba9

Browse files
committed
avoid _argument_isless
1 parent 900321a commit 3ba3ba9

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ function arguments_product(s1, s2)
8484
return throw(ArgumentError("Mixing non-empty storage types is illegal"))
8585
end
8686

87-
function arguments_isless(a1, a2)
88-
isempty(a1) && return _arguments_isless(empty(a2), a2)
89-
isempty(a2) && return _arguments_isless(a1, empty(a1))
90-
return isless(sym_arguments_maybe_insert_unspecified(a1, a2)...)
87+
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)...)
9191
end
9292

9393
# ================================= Cartesian Product ====================================
@@ -187,9 +187,6 @@ function arguments_maybe_insert_unspecified(t1::Tuple, t2::Tuple)
187187
return (t1..., trivial.(t2[(n1 + 1):end])...)
188188
end
189189

190-
function _arguments_isless(t1::Tuple, t2::Tuple)
191-
return isless(sym_arguments_maybe_insert_unspecified(t1, t2)...)
192-
end
193190
# =========================== Dictionary-like implementation =============================
194191
function SectorProduct(nt::NamedTuple)
195192
arguments = sort_keys(nt)
@@ -241,7 +238,3 @@ function shared_arguments_fusion_rule(shared1::NT, shared2::NT) where {NT<:Named
241238
tuple_fused = shared_arguments_fusion_rule(values(shared1), values(shared2))
242239
return map_blocklabels(SectorProduct NT arguments SectorProduct, tuple_fused)
243240
end
244-
245-
function _arguments_isless(nt1::NamedTuple, nt2::NamedTuple)
246-
return isless(sym_arguments_maybe_insert_unspecified(nt1, nt2)...)
247-
end

0 commit comments

Comments
 (0)