Skip to content

Commit

Permalink
Remove redundant warnings in show
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsignorelli committed Mar 29, 2024
1 parent bd844d4 commit c8ba8d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function show_vec(io::IO, m::Vector{<:Union{TPS,ComplexTPS}})
desc = unsafe_load(Base.unsafe_convert(Ptr{Desc}, unsafe_load(first(m).tpsa).d))
diffdescs = false
for i in eachindex(m)
if desc != unsafe_load(Base.unsafe_convert(Ptr{Desc}, unsafe_load(m[i].tpsa).d))
if !diffdescs && desc != unsafe_load(Base.unsafe_convert(Ptr{Desc}, unsafe_load(m[i].tpsa).d))
println(io, "WARNING: Atleast one $(eltype(m)) has a different Descriptor!")
diffdescs = true
lines_used[] += 1
Expand Down Expand Up @@ -330,7 +330,9 @@ function show_map!(io::IO, m::Vector{<:Union{TPS,ComplexTPS}}, lines_used::Ref=R
for i in eachindex(m)
curdesc = unsafe_load(Base.unsafe_convert(Ptr{Desc}, unsafe_load(m[i].tpsa).d))
if only_vars && (desc.nv != curdesc.nv)
error("Cannot use only_vars = true for vector with TPSs having different number of variables")
println(io, "Cannot print $(typeof(m)): unable to resolve GTPSA Descriptor.")
lines_used[]+=1
return
end
max_nn = max(max_nn, curdesc.nv+curdesc.np)
end
Expand Down

0 comments on commit c8ba8d2

Please sign in to comment.