millList 清空时只需将 millListSize 设置为0即可而不需要 memset 清零

This commit is contained in:
Calcitem 2020-02-26 00:40:46 +08:00
parent 4aefae4926
commit 039ffea016
2 changed files with 0 additions and 7 deletions

View File

@ -34,13 +34,11 @@ int Board::millTable[SQ_EXPANDED_COUNT][LINE_TYPES_COUNT][N_RINGS - 1] = { {{0}}
Board::Board()
{
memset(&millList, 0, sizeof(millList));
millListSize = 0;
}
Board::~Board()
{
memset(&millList, 0, sizeof(millList));
millListSize = 0;
}
@ -51,9 +49,6 @@ Board &Board::operator= (const Board &other)
memcpy(this->locations, other.locations, sizeof(this->locations));
memset(&millList, 0, sizeof(millList));
millListSize = 0;
memcpy(&millList, &other.millList, sizeof(millList));
millListSize = other.millListSize;

View File

@ -159,7 +159,6 @@ bool Game::setPosition(const struct Rule *newRule,
}
// 清空成三记录
memset(&position->board.millList, 0, sizeof(position->board.millList));
position->board.millListSize = 0;
// 胜负标识
@ -234,7 +233,6 @@ bool Game::reset()
position->nPiecesNeedRemove = 0;
// 清空成三记录
memset(&position->board.millList, 0, sizeof(position->board.millList));
position->board.millListSize = 0;
// 不选中棋子