在关键路径上去除不必要的变量初始化

自对弈4000盘,提升速度8%左右。
This commit is contained in:
Calcitem 2020-05-03 09:03:01 +08:00
parent 9d715fc6a0
commit e3e7c11f26
3 changed files with 6 additions and 6 deletions

View File

@ -25,9 +25,9 @@ value_t Evaluation::getValue(StateInfo *st, Position *position, Node *node)
// 初始评估值为0对先手有利则增大对后手有利则减小
value_t value = VALUE_ZERO;
int nPiecesInHandDiff = std::numeric_limits<int>::max();
int nPiecesOnBoardDiff = std::numeric_limits<int>::max();
int nPiecesNeedRemove = 0;
int nPiecesInHandDiff;
int nPiecesOnBoardDiff;
int nPiecesNeedRemove;
#ifdef DEBUG_AB_TREE
node->phase = position->phase;

View File

@ -62,8 +62,8 @@ void StateInfo::generateChildren(const Stack<move_t, MOVE_COUNT> &moves,
int StateInfo::generateMoves(Stack<move_t, MOVE_COUNT> &moves)
{
square_t square = SQ_0;
player_t opponent = PLAYER_NOBODY;
square_t square;
player_t opponent;
moves.clear();

View File

@ -675,7 +675,7 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
value_t value;
// 临时增加的深度,克服水平线效应用
depth_t epsilon = 0;
depth_t epsilon;
#ifdef BEST_MOVE_ENABLE
// 子节点的最优着法