diff --git a/examples/FieldEnumeration/abelian_extensions.jl b/examples/FieldEnumeration/abelian_extensions.jl index 882ea23b4a..fbcc60d99e 100644 --- a/examples/FieldEnumeration/abelian_extensions.jl +++ b/examples/FieldEnumeration/abelian_extensions.jl @@ -135,9 +135,9 @@ function main() error("Input file must be specified by --input") end - if dbound == nothing && rdbound == nothing + if dbound === nothing && rdbound === nothing error("One of --disc-bound or --rootdisc-bound must be specified") - elseif dbound != nothing && rdbound != nothing + elseif dbound !== nothing && rdbound !== nothing error("Only one of --disc-bound or --rootdisc-bound can be set") end diff --git a/examples/FieldEnumeration/all_fields.jl b/examples/FieldEnumeration/all_fields.jl index 44b4102e1b..f36185d7ae 100644 --- a/examples/FieldEnumeration/all_fields.jl +++ b/examples/FieldEnumeration/all_fields.jl @@ -161,9 +161,9 @@ function main() set_verbose_level(:FieldsNonFancy, 3) end - if dbound == nothing && rdbound == nothing + if dbound === nothing && rdbound === nothing error("One of --disc-bound or --rootdisc-bound must be specified") - elseif dbound != nothing && rdbound != nothing + elseif dbound !== nothing && rdbound !== nothing error("Only one of --disc-bound or --rootdisc-bound can be set") end diff --git a/examples/MultDep.jl b/examples/MultDep.jl index 204369c640..51e0d8cc46 100644 --- a/examples/MultDep.jl +++ b/examples/MultDep.jl @@ -245,7 +245,7 @@ function mult_syzygies_units(A::Vector{FacElem{nf_elem, AnticNumberField}}) s = QQFieldElem[] for x = k[1] @vtime :qAdic 1 y = lift_reco(FlintQQ, x, reco = true) - if y == nothing + if y === nothing prec *= 2 @vprint :qAdic 1 "increase prec to ", prec lu = matrix([conjugates_log(x, C, prec, all = false, flat = true) for x = u])' diff --git a/src/AlgAssAbsOrd/Conjugacy/Conjugacy.jl b/src/AlgAssAbsOrd/Conjugacy/Conjugacy.jl index 2a3fda5eb9..193e0d3940 100644 --- a/src/AlgAssAbsOrd/Conjugacy/Conjugacy.jl +++ b/src/AlgAssAbsOrd/Conjugacy/Conjugacy.jl @@ -102,7 +102,7 @@ function _compute_decomposition!(C::CommutatorAlgebra) M = invariant_factors_grouped[l][3] for (i, j, e) in M o = findfirst(x -> x[1] == e, D) - if o == nothing + if o === nothing push!(D, (e, Tuple{Int, Int}[(i, j)])) else push!(D[o][2], (i, j)) diff --git a/src/AlgAssAbsOrd/NEQ.jl b/src/AlgAssAbsOrd/NEQ.jl index 9f6ff20c56..fbc0ee851e 100644 --- a/src/AlgAssAbsOrd/NEQ.jl +++ b/src/AlgAssAbsOrd/NEQ.jl @@ -272,7 +272,7 @@ function _norm_equation_absolute(NC::NormCache, order_num::Int; max_num_fields:: if degree(K) == n UK, mUK = unit_group_fac_elem(OK) i = findfirst(x -> norm(mUK(x)) == -1, gens(UK)) - if i != nothing + if i !== nothing NC.norm_minus_one[order_num] = KtoA(evaluate(mUK(UK[i]))) end end diff --git a/src/EllCrv/Periods.jl b/src/EllCrv/Periods.jl index d0b9b814ca..35eea60f8c 100644 --- a/src/EllCrv/Periods.jl +++ b/src/EllCrv/Periods.jl @@ -78,7 +78,7 @@ function period_real_embedding(E::EllCrv{T}, phi, prec::Int = 100) where T<: Uni while true precnew = attempt*prec - if phi == nothing + if phi === nothing b2, b4, b6, b8 = map(ArbField(precnew), b_invars(E)) else b2, b4, b6, b8 = map(real, (map(evaluation_function(phi, precnew), b_invars(E)))) @@ -130,7 +130,7 @@ function period_complex_embedding(E::EllCrv{T}, phi, prec = 100) where T <: Unio while true precnew = attempt*prec - if phi == nothing + if phi === nothing b2, b4, b6, b8 = map(AcbField(precnew), b_invars(E)) else b2, b4, b6, b8 = map(evaluation_function(phi, precnew), b_invars(E)) diff --git a/src/Grp/Morphisms.jl b/src/Grp/Morphisms.jl index fd39561b3f..ed064bc788 100644 --- a/src/Grp/Morphisms.jl +++ b/src/Grp/Morphisms.jl @@ -22,7 +22,7 @@ Returns one element of the preimage of $g$ under $f$. """ function preimage(f::GrpGenToGrpGenMor, g::GrpGenElem) h = findfirst(x -> f(x) == g, collect(f.domain)) - if h == nothing + if h === nothing error("$g has no preimage under $f") end return f.domain[h] @@ -36,7 +36,7 @@ element $h$ with $f(h) = g$. """ function has_preimage(f::GrpGenToGrpGenMor, g::GrpGenElem) h = findfirst(x -> f(x) == g, collect(f.domain)) - if h == nothing + if h === nothing return false end return (true, f.domain[h]) diff --git a/src/GrpAb/GrpAbFinGen.jl b/src/GrpAb/GrpAbFinGen.jl index 559b054700..7d760a7c92 100644 --- a/src/GrpAb/GrpAbFinGen.jl +++ b/src/GrpAb/GrpAbFinGen.jl @@ -1703,7 +1703,7 @@ function find_isomorphism_with_abelian_group(G::Vector{NfToNfMor}) el = compose_mod(el, pow(Rx(S[i].prim_img), (x, y) -> Hecke.compose_mod(x, y, Rx(K.pol)), v[i], gen(Rx)), Rx(K.pol)) end ind = findfirst(x -> Rx(x.prim_img) == el, G) - @assert ind != nothing + @assert ind !== nothing AsnftoG[a] = G[ind] end diff --git a/src/GrpAb/Lattice.jl b/src/GrpAb/Lattice.jl index 1d56d922cb..556d1ca994 100644 --- a/src/GrpAb/Lattice.jl +++ b/src/GrpAb/Lattice.jl @@ -471,7 +471,7 @@ function update!(L::RelLattice) Base.delete!(L.weak_vertices_rev, k) continue end - @assert L.weak_vertices_rev[k].value != nothing + @assert L.weak_vertices_rev[k].value !== nothing a = L.weak_vertices_rev[k].value @assert k == objectid(a) @assert L.graph.degrees[k] < 2 @@ -524,7 +524,7 @@ function can_map_into_overstructure(L::RelLattice{T, D}, G::T, H::T) where {T, D if b @assert pG[1] == pH[1] M = L.weak_vertices_rev[pG[1]].value::T - @assert M != nothing + @assert M !== nothing mG = eval_path(L, M, pG) mH = eval_path(L, M, pH) diff --git a/src/Misc/Integer.jl b/src/Misc/Integer.jl index 02db2639cf..a4fcd46297 100644 --- a/src/Misc/Integer.jl +++ b/src/Misc/Integer.jl @@ -1037,7 +1037,7 @@ Base.eltype(::Divisors{T}) where T = T function Base.iterate(D::Divisors) x = iterate(D.s) - if x == nothing + if x === nothing return x end return D.f(x[1]), x[2] @@ -1045,7 +1045,7 @@ end function Base.iterate(D::Divisors, i) x = iterate(D.s, i) - if x == nothing + if x === nothing return x end return D.f(x[1]), x[2] diff --git a/src/NumField/NfAbs/MPolyGcd.jl b/src/NumField/NfAbs/MPolyGcd.jl index 44bac2ac86..2a894fbef6 100644 --- a/src/NumField/NfAbs/MPolyGcd.jl +++ b/src/NumField/NfAbs/MPolyGcd.jl @@ -400,7 +400,7 @@ function Hecke.induce_crt(a::Hecke.Generic.MPoly{nf_elem}, p::ZZRingElem, b::Hec while !(aa === nothing) push_term!(c, Hecke.induce_inner_crt(coeff(aa, 1), z, pi, pq, pq2), exponent_vector(aa, 1)) aa = iterate(ta, sa) - if !aa == nothing + if !aa === nothing aa, sa = aa end end diff --git a/src/NumField/NfAbs/NormRelation/SUnits.jl b/src/NumField/NfAbs/NormRelation/SUnits.jl index c5a70746f0..4d0a9b93d5 100644 --- a/src/NumField/NfAbs/NormRelation/SUnits.jl +++ b/src/NumField/NfAbs/NormRelation/SUnits.jl @@ -408,7 +408,7 @@ function _find_perm(v::Vector{NfOrdIdl}, w::Vector{NfOrdIdl}) p = Dict{Int, Int}() for i = 1:length(v) pi = findfirst(isequal(v[i]), w) - @assert pi != nothing + @assert pi !== nothing p[pi] = i end return p diff --git a/src/NumFieldOrd/NfOrd/Clgp.jl b/src/NumFieldOrd/NfOrd/Clgp.jl index 055c2dc176..5c7ec8d63f 100644 --- a/src/NumFieldOrd/NfOrd/Clgp.jl +++ b/src/NumFieldOrd/NfOrd/Clgp.jl @@ -469,11 +469,11 @@ function unit_group_fac_elem(O::NfOrd; method::Int = 3, unit_method::Int = 1, us end U = get_attribute(O, :UnitGrpCtx) - if U != nothing && U.finished + if U !== nothing && U.finished return unit_group_fac_elem(U::UnitGrpCtx) end c = get_attribute(O, :ClassGrpCtx) - if c == nothing + if c === nothing O = lll(maximal_order(nf(O))) end _, UU, b = _class_unit_group(O, method = method, unit_method = unit_method, use_aut = use_aut, GRH = GRH, redo = redo) @@ -488,7 +488,7 @@ Computes the regulator of $O$, i.e. the discriminant of the unit lattice. """ function regulator(O::NfOrd; method::Int = 3, unit_method::Int = 1, use_aut::Bool = false, GRH::Bool = true) c = get_attribute(O, :ClassGrpCtx) - if c == nothing + if c === nothing O = lll(maximal_order(nf(O))) end c, U, b = _class_unit_group(O, method = method, unit_method = unit_method, use_aut = use_aut, GRH = GRH) diff --git a/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl b/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl index f9e37b4088..2852305d35 100644 --- a/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl +++ b/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl @@ -14,7 +14,7 @@ function single_env(c::ClassGrpCtx{T}, I::Hecke.SmallLLLRelationsCtx, rat::Float if I.cnt > length(I.b)^2 break end - if n == nothing + if n === nothing #@show "BadNorm" bad_norm += 1 if I.cnt > 100 && bad_norm / I.cnt > 0.1 diff --git a/src/NumFieldOrd/NfOrd/Clgp/Map.jl b/src/NumFieldOrd/NfOrd/Clgp/Map.jl index 25f4d8ca67..fa070dfe4e 100644 --- a/src/NumFieldOrd/NfOrd/Clgp/Map.jl +++ b/src/NumFieldOrd/NfOrd/Clgp/Map.jl @@ -423,7 +423,7 @@ function _isprincipal_fac_elem(A::NfOrdIdl, support::Type{Val{U}} = Val{false}) end end c = get_attribute(O, :ClassGrpCtx) - if c == nothing + if c === nothing L = lll(maximal_order(nf(O))) class_group(L) c = get_attribute(L, :ClassGrpCtx)::Hecke.ClassGrpCtx{SMat{ZZRingElem, ZZRingElem_Array_Mod.ZZRingElem_Array}} diff --git a/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl b/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl index 1edc6192a0..1b3e151031 100644 --- a/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl +++ b/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl @@ -29,7 +29,7 @@ function sunit_mod_units_group_fac_elem(I::Vector{NfOrdIdl}) @vprintln :ClassGroup 1 "calling sunit_mod_units_group_fac_elem with $(length(I)) ideals" c = get_attribute(O, :ClassGrpCtx) - if c == nothing + if c === nothing L = lll(maximal_order(nf(O))) class_group(L) c = get_attribute(L, :ClassGrpCtx) diff --git a/src/QuadForm/Quad/ZLattices.jl b/src/QuadForm/Quad/ZLattices.jl index 744ccd413f..8c939073e4 100644 --- a/src/QuadForm/Quad/ZLattices.jl +++ b/src/QuadForm/Quad/ZLattices.jl @@ -80,7 +80,7 @@ function quadratic_lattice(::QQField, gens::Vector{T}; gram = nothing, check::Bo return quadratic_lattice(QQ, B, gram = gram, check = check) end @assert length(gens[1]) > 0 - if gram == nothing + if gram === nothing gram = identity_matrix(QQ, length(gens[1])) end if check @@ -1730,7 +1730,7 @@ function _irreducible_components_pos_def(L::ZZLat, upper_bound=nothing) # fall back to short vectors for c in components3 - if upper_bound == nothing + if upper_bound === nothing ub = maximum([abs(i) for i in diagonal(gram_matrix(c))]) else ub = upper_bound diff --git a/src/QuadForm/Torsion.jl b/src/QuadForm/Torsion.jl index 59d44b35bd..d2bd55f321 100644 --- a/src/QuadForm/Torsion.jl +++ b/src/QuadForm/Torsion.jl @@ -44,7 +44,7 @@ function torsion_quadratic_module(M::ZZLat, N::ZZLat; gens::Union{Nothing, Vecto A = abelian_group(rels) n = dim(ambient_space(M)) BM = basis_matrix(M) - if gens != nothing && length(gens)>0 + if gens !== nothing && length(gens)>0 gens_in_A = elem_type(A)[] for g in gens @req length(g) == n "Generator not an element of the ambient space" @@ -70,7 +70,7 @@ function torsion_quadratic_module(M::ZZLat, N::ZZLat; gens::Union{Nothing, Vecto end # mS : S -> A # generators of S lifted along M -> M/N = A -> S - if gens != nothing && length(gens)>0 + if gens !== nothing && length(gens)>0 gens_lift = gens else gens_lift = Vector{QQFieldElem}[reshape(collect(change_base_ring(FlintQQ, mS(s).coeff) * BM), :) for s in Hecke.gens(S)] diff --git a/test/Map/NumberField.jl b/test/Map/NumberField.jl index da10671759..f85aeead9b 100644 --- a/test/Map/NumberField.jl +++ b/test/Map/NumberField.jl @@ -20,7 +20,7 @@ end for i = 1:length(lP) I_new = A[2](lP1[1]) id = findfirst(isequal(I_new), lP1) - @test id != nothing + @test id !== nothing end f = hom(K, K, a^4//12+a//2) E = EquationOrder(K) diff --git a/test/NfAbs/NfAbs.jl b/test/NfAbs/NfAbs.jl index e9a456506e..55e9ca1f84 100644 --- a/test/NfAbs/NfAbs.jl +++ b/test/NfAbs/NfAbs.jl @@ -44,7 +44,7 @@ if n % m != 0 && ! (isodd(n) && (2*n) % m == 0) Fm, zm = CyclotomicField(m) @test_throws ErrorException Hecke.force_coerce_cyclo(Fn, zm) - @test Hecke.force_coerce_cyclo(Fn, zm, Val{false}) == nothing + @test Hecke.force_coerce_cyclo(Fn, zm, Val{false}) === nothing end end end diff --git a/test/testdefs.jl b/test/testdefs.jl index 6b4e90fa5d..22212c256f 100644 --- a/test/testdefs.jl +++ b/test/testdefs.jl @@ -19,7 +19,7 @@ function runtests(name, path; isolate=false, seed=nothing) end res_and_time_data = @timed @testset "$name" begin # Random.seed!(nothing) will fail - seed != nothing && Random.seed!(seed) + seed !== nothing && Random.seed!(seed) Base.include(m, "$path") end rss = Sys.maxrss()