Skip to content

Commit 8558626

Browse files
committed
Avoid a costly deep-copy
1 parent e40aa3c commit 8558626

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ updates:
1414
prefix: "[pip prod] "
1515
prefix-development: "[pip dev] "
1616
include: "scope"
17+
cooldown:
18+
default-days: 7

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ repos:
4545
rev: v1.18.0
4646
hooks:
4747
- id: zizmor
48+
args: ["--fix", "--no-progress"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Graphical Checkers Game with AI support
33

44
<!-- BADGIE TIME -->
55

6+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/CoolCat467/Checkers/main.svg)](https://results.pre-commit.ci/latest/github/CoolCat467/Checkers/main)
67
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
78

89
<!-- END BADGIE TIME -->

src/checkers/state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
__license__ = "GNU General Public License Version 3"
2525
__version__ = "0.0.0"
2626

27-
import copy
2827
import math
2928
from dataclasses import dataclass
3029
from typing import (
@@ -271,7 +270,8 @@ def get_jumps(
271270
piece_type = self.pieces[position]
272271
if _pieces is None:
273272
_pieces = self.pieces
274-
_pieces = copy.deepcopy(_pieces)
273+
# _pieces = copy.deepcopy(_pieces)
274+
_pieces = dict(_pieces)
275275

276276
enemy_pieces = self.get_piece_types(self.get_enemy(piece_type))
277277

0 commit comments

Comments
 (0)