Skip to content

Commit

Permalink
Define == instead of isequal
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoît Richard committed Mar 22, 2023
1 parent 60c05a1 commit b857180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PeriodicTable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function Base.show(io::IO, ::MIME"text/plain", e::Elements)
end

# Since Element equality is determined by atomic number alone...
Base.isequal(elm1::Element, elm2::Element) = elm1.number == elm2.number
Base.:(==)(elm1::Element, elm2::Element) = elm1.number == elm2.number

# There is no need to use all the data in Element to calculated the hash
# since Element equality is determined by atomic number alone.
Expand Down

0 comments on commit b857180

Please sign in to comment.