Skip to content

Commit

Permalink
Merge pull request #49 from Kolaru/replace_isequal
Browse files Browse the repository at this point in the history
Define == instead of isequal
  • Loading branch information
carstenbauer authored Jul 28, 2023
2 parents c1cc76d + b857180 commit 1622441
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 1622441

Please sign in to comment.