Skip to content

Commit

Permalink
Merge pull request #1234 from WardLT/faster_equality
Browse files Browse the repository at this point in the history
Added shortcut if structures is equal to self
  • Loading branch information
shyuep committed Aug 10, 2018
2 parents 4311bac + 5259505 commit 10cf55a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymatgen/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,8 @@ def matches(self, other, **kwargs):
return m.fit(Structure.from_sites(self), Structure.from_sites(other))

def __eq__(self, other):
if other is self:
return True
if other is None:
return False
if len(self) != len(other):
Expand Down

0 comments on commit 10cf55a

Please sign in to comment.