Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements minor readability changes. #260

Merged
merged 11 commits into from
Dec 1, 2023
Prev Previous commit
Next Next commit
Prefer .append on list type for performance.
tonypr committed Dec 1, 2023
commit 9711bcbef26b581fd90438abaaf28fa96fad7978
2 changes: 1 addition & 1 deletion catanatron_core/catanatron/models/board.py
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@ def longest_acyclic_path(board: Board, node_set: Set[int], color: Color):
continue # enemy-owned, cant use this to navigate.
edge = tuple(sorted((node, neighbor_node)))
if edge not in path_thus_far:
agenda.insert(0, (neighbor_node, path_thus_far + [edge]))
agenda.append((neighbor_node, path_thus_far + [edge]))
able_to_navigate = True

if not able_to_navigate: # then it is leaf node