Skip to content

Commit

Permalink
Make Atom.apply_action more consistent (and slightly faster)
Browse files Browse the repository at this point in the history
Tiny change. Increases readability and presumably speed.
  • Loading branch information
rwest authored and mazeau committed Feb 20, 2020
1 parent 0a04564 commit da26b1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rmgpy/molecule/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ def apply_action(self, action):
for i in range(action[2]): self.increment_radical()
elif act == 'LOSE_RADICAL':
for i in range(abs(action[2])): self.decrement_radical()
elif action[0].upper() == 'GAIN_PAIR':
elif act == 'GAIN_PAIR':
for i in range(action[2]): self.increment_lone_pairs()
elif action[0].upper() == 'LOSE_PAIR':
elif act == 'LOSE_PAIR':
for i in range(abs(action[2])): self.decrement_lone_pairs()
else:
raise gr.ActionError('Unable to update Atom: Invalid action {0}".'.format(action))
Expand Down

0 comments on commit da26b1d

Please sign in to comment.