Skip to content

Commit aca0b34

Browse files
rwestssun30
authored andcommitted
Small efficiency gain checking for charged species.
I couldn't help myself, while doing code review.
1 parent 53059fe commit aca0b34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rmgpy/data/kinetics/family.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,9 +1701,9 @@ def _create_reaction(self, reactants, products, is_forward):
17011701
)
17021702

17031703
if not self.allow_charged_species:
1704-
charged_species = [spc for spc in (reaction.reactants + reaction.products) if spc.get_net_charge() != 0]
1705-
if charged_species:
1706-
return None
1704+
for spc in (reaction.reactants + reaction.products):
1705+
if spc.get_net_charge() != 0:
1706+
return None
17071707

17081708
if not reaction.is_balanced():
17091709
return None

0 commit comments

Comments
 (0)