-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare 'nothing' using === not == #2931
Conversation
... for optimal code results. While in most cases it won't matter, it is a good habit to just always adhere to this.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something is missing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed sigh. I'll send a follow up PR.
@@ -341,9 +340,10 @@ 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 return MatrixGroupElem(G,x.elm) | |||
else return MatrixGroupElem(G,x.elm,x_gap) | |||
if x_gap == nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
Why not use |
https://docs.julialang.org/en/v1.6/manual/performance-tips/#Checking-for-equality-with-a-singleton (Should be the same starting with 1.7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @fingolfin . Looks good to me.
There were a few cases missing, which should have been fixed before merging this |
I still don't understand why not to use |
I wanted to minimize the changes, that was very easy with a reggex changing |
|
(My apologies for moving this along too quickly.) |
... for optimal code results. While in most cases it won't matter, it is
a good habit to just always adhere to this.