Skip to content

Commit a118319

Browse files
committed
Simplify 'is_trace'
1 parent 805a227 commit a118319

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/std.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -545,19 +545,11 @@ function parenthesize_std(arg::BinaryOperation{Mult})
545545
return _to_std_string(arg)
546546
end
547547

548-
# TODO: Remove
549548
function is_trace(arg)
550549
terms = collect_factors(arg)
551550

552551
if length(terms) == 1
553-
ids = get_indices(arg)
554-
free_ids = get_free_indices(arg)
555-
556-
if length(ids) == 2 && isempty(free_ids)
557-
return true
558-
else
559-
return false
560-
end
552+
return length(get_indices(first(terms))) == 2 && isempty(get_free_indices(arg))
561553
end
562554

563555
return all(length.(get_free_indices.(terms)) .== 2) && isempty(get_free_indices(arg))

0 commit comments

Comments
 (0)