Commit 1fc8bef
Avoid calling fails_species_constraints twice on rejection
We called fails_species_constraints in the `if` condition
and then again to retrieve the `reason` string for the exception
message. Since the function already returns either False or the reason
string, store the result once and branch on it. This halves the
constraint-checking work on the rejection path (the expensive path,
where a failing check actually runs) with no change in behavior.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 31b220b commit 1fc8bef
3 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1655 | 1655 | | |
1656 | 1656 | | |
1657 | 1657 | | |
1658 | | - | |
1659 | | - | |
| 1658 | + | |
| 1659 | + | |
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
| 737 | + | |
| 738 | + | |
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
741 | | - | |
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1739 | 1739 | | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | | - | |
| 1742 | + | |
| 1743 | + | |
1743 | 1744 | | |
1744 | 1745 | | |
1745 | 1746 | | |
1746 | | - | |
1747 | 1747 | | |
1748 | 1748 | | |
1749 | 1749 | | |
| |||
1867 | 1867 | | |
1868 | 1868 | | |
1869 | 1869 | | |
1870 | | - | |
| 1870 | + | |
| 1871 | + | |
1871 | 1872 | | |
1872 | 1873 | | |
1873 | 1874 | | |
1874 | | - | |
1875 | 1875 | | |
1876 | 1876 | | |
1877 | 1877 | | |
| |||
0 commit comments