Skip to content

Commit

Permalink
Address some JET warnings / errors (#1707)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed May 23, 2024
1 parent 8a5e06f commit 2f8952b
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/AbsMSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function show(io::IO, mime::MIME"text/plain", p::MSeriesRing)
print(io, " in ", ItemQuantity(nvars(p), "variable"), " ")
if n > max_vars
join(io, symbols(p)[1:max_vars - 1], ", ")
println(io, ", ..., ", symbols(a)[n])
println(io, ", ..., ", symbols(p)[n])
else
join(io, symbols(p), ", ")
println(io)
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function canonical_injections(D)
end

function canonical_projections(D)
return [canonical_projections(D, i) for i=1:_number_of_direct_product_factors(D)]
return [canonical_projection(D, i) for i=1:_number_of_direct_product_factors(D)]
end

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/Groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
###############################################################################

Base.one(G::Group) = throw(NotImplementedError(:parent, g))
Base.one(G::Group) = throw(NotImplementedError(:parent, G))

Base.parent(g::GroupElem) = throw(NotImplementedError(:parent, g))

Expand Down
2 changes: 1 addition & 1 deletion src/LaurentMPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function show(io::IO, mime::MIME"text/plain", p::LaurentMPolyRing)
print(io, " in ", ItemQuantity(nvars(p), "variable"), " ")
if n > max_vars
join(io, symbols(p)[1:max_vars - 1], ", ")
println(io, ", ..., ", symbols(a)[n])
println(io, ", ..., ", symbols(p)[n])
else
join(io, symbols(p), ", ")
println(io)
Expand Down
2 changes: 1 addition & 1 deletion src/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function Base.iterate(M::MatSpace)
state_type = typeof(iterate(R)[2])
st = (elem_type(R)[], state_type[])
else
a, st = iterate(p) # R is presumably not empty
a, st = iterate(p)::Tuple{Any, Any} # R is presumably not empty
end
M(a), (p, st)
end
Expand Down
1 change: 1 addition & 0 deletions src/Module.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ function Base.iterate(M::FPModule{T}) where T <: FinFieldElem
end
p = Base.Iterators.ProductIterator(Tuple([k for i=1:dim(M)]))
f = iterate(p)
@assert f !== nothing
return M(elem_type(k)[f[1][i] for i=1:dim(M)]), (f[2], p)
end

Expand Down
2 changes: 1 addition & 1 deletion src/broadcasting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ end
Base.copyto!(dest::MatElem, bc::Broadcast.Broadcasted) = Base.copyto!(dest, convert(Broadcast.Broadcasted{Nothing}, bc))

function Base.copyto!(dest::MatElem, bc::Broadcast.Broadcasted{Nothing})
axes(dest) == axes(bc) || throwdm(axes(dest), axes(bc))
axes(dest) == axes(bc) || Broadcast.throwdm(axes(dest), axes(bc))
# Performance optimization: broadcast!(identity, dest, A) is equivalent to copyto!(dest, A) if indices match
if bc.f === identity && bc.args isa Tuple{AbstractArray} # only a single input argument to broadcast!
A = bc.args[1]
Expand Down
4 changes: 0 additions & 4 deletions src/generic/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1387,10 +1387,6 @@ struct nheap_t
next::Int
end

function ==(a::heap_s, b::heap_s)
return exps[a.exp] == exps[b.exp]
end

heapleft(i::Int) = 2i
heapright(i::Int) = 2i + 1
heapparent(i::Int) = div(i, 2)
Expand Down
2 changes: 1 addition & 1 deletion src/generic/Misc/Rings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function is_power(a::RingElem, n::Int)
return true, a
end
R = parent(a)
Rt = PolyRing(R)
Rt = AbstractAlgebra.PolyRing(R)
x = gen(Rt)
r = roots(x^n - a)
if length(r) == 0
Expand Down

0 comments on commit 2f8952b

Please sign in to comment.