Skip to content

Commit

Permalink
perf: calculate WIN_SHAPES size ⚡
Browse files Browse the repository at this point in the history
  • Loading branch information
Joker2770 committed Jul 24, 2024
1 parent cb19151 commit db2b42b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CaroJudge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ bool CaroJudge::findShap(const board_type &board, int last_move, const pair<int,

if (vColor.size() >= 7)
{
size_t win_shape_size = sizeof(WIN_SHAPES) / sizeof(WIN_SHAPES[0]);
for (size_t j = 0; j <= vColor.size() - 7; ++j)
{
for (size_t i = 0; i < 46; ++i)
for (size_t i = 0; i < win_shape_size; ++i)
{
if (((WIN_SHAPES[i][0]) == (vColor[j])) &&
((WIN_SHAPES[i][1]) == (vColor[j + 1])) &&
Expand Down

0 comments on commit db2b42b

Please sign in to comment.