Skip to content

Commit

Permalink
Refactor removeVanDerWaalsBonds to not modify dict while iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
mliu49 committed Sep 10, 2019
1 parent 34b3bc0 commit 6c8004e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rmgpy/molecule/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,10 +1132,9 @@ def removeVanDerWaalsBonds(self):
Remove all bonds that are definitely only van der Waals bonds.
"""
cython.declare(atom=GroupAtom, bond=GroupBond)
for atom in self.atoms:
for bond in atom.edges.values():
if bond.isVanDerWaals(wildcards=False):
self.removeBond(bond)
for bond in self.getAllEdges():
if bond.isVanDerWaals(wildcards=False):
self.removeBond(bond)

def sortAtoms(self):
"""
Expand Down

0 comments on commit 6c8004e

Please sign in to comment.