Skip to content

Commit

Permalink
tiny optimization in triangulation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Aug 30, 2023
1 parent cb68203 commit 7836a0e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions veerer/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,8 +1578,17 @@ def _automorphism_good_starts(self):
else:
d[s] = [i]

m = min(len(x) for x in d.values())
winner = min(s for s, v in d.items() if len(v) == m)
winner = None
values = None
for s, v in d.items():
if winner is None:
winner = s
values = v
elif len(v) < len(values):
winner = s
values = v
elif len(v) == len(values) and s < winner:
winner = s

return d[winner]

Expand Down

0 comments on commit 7836a0e

Please sign in to comment.