Skip to content

Commit

Permalink
Compare 'nothing' using === in more places (#2933)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Oct 18, 2023
1 parent e7d1cf8 commit a98d2d5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Combinatorics/Matroids/matroids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Matroid of rank 3 on 7 elements
```
"""
function matroid_from_revlex_basis_encoding(rvlx::String, r::IntegerUnion, n::IntegerUnion)
if match(r"[^*0]",rvlx)!=nothing
if match(r"[^*0]",rvlx) !== nothing
error("The revlex encoding uses only `*` and `0`")
end
if length(rvlx)!= binomial(n,r)
Expand Down
2 changes: 1 addition & 1 deletion src/Combinatorics/Matroids/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function flats_impl(M::Matroid, r::Union{Int,Nothing}, num_flats::Int, pm_flats)
jl_flats = reverse(jl_flats)
end
matroid_flats = [[M.groundset[i] for i in flat] for flat in jl_flats]
if r != nothing
if r !== nothing
if r<0 || r>rank(M)
error("The specified rank needs to be between 0 and the rank of the matroid.")
end
Expand Down
6 changes: 4 additions & 2 deletions src/Groups/matrices/MatGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ Base.in(x::MatElem, G::MatrixGroup) = lies_in(x,G,nothing)[1]
function Base.in(x::MatrixGroupElem, G::MatrixGroup)
isdefined(x,:X) && return lies_in(x.elm,G,x.X)[1]
_is_true, x_gap = lies_in(x.elm,G,nothing)
if x_gap !=nothing x.X = x_gap end
if x_gap !== nothing
x.X = x_gap
end
return _is_true
end

Expand Down Expand Up @@ -340,7 +342,7 @@ function (G::MatrixGroup)(x::MatrixGroupElem; check::Bool=true)
else
_is_true, x_gap = lies_in(x.elm,G,nothing)
@req _is_true "Element not in the group"
if x_gap == nothing
if x_gap === nothing
return MatrixGroupElem(G,x.elm)
end
return MatrixGroupElem(G,x.elm,x_gap)
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/ModulesGraded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ function Base.show(io::IO, b::BettiTable)
column_widths[j] = max(col_width_from_sum, col_width_from_header) + 2
end

if b.project == nothing
if b.project === nothing
for i in 1:ngens(parent(x[1][2]))
ngens(parent(x[1][2])) > 1 && println(io, "Betti Table for component ", i)
L = sort(unique(collect(x[k][2][i] for k in 1:length(x))))
Expand Down
2 changes: 1 addition & 1 deletion src/TropicalGeometry/groebner_fan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ julia> G3 = [x1^2+x2,x2^2+x3,x3+1]
x2^2 + x3
x3 + 1
julia> homogeneity_vector(G3) == nothing
julia> homogeneity_vector(G3) === nothing
true
```
Expand Down

0 comments on commit a98d2d5

Please sign in to comment.