mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Remove redundant argument in think()
We don't need to pass side_to_move because we can get it directly from the position object. Note that in benchmark we always used to pass '0' and it was a bug, but with no effect because was used only in time[] and increment[], set always to 0 for both colors. Also additional small cleanup while there. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
16
src/uci.cpp
16
src/uci.cpp
@@ -79,7 +79,7 @@ namespace {
|
||||
|
||||
void uci_main_loop() {
|
||||
|
||||
RootPosition.from_fen(StartPosition);
|
||||
RootPosition.from_fen(StartPositionFEN);
|
||||
string command;
|
||||
|
||||
do {
|
||||
@@ -127,7 +127,7 @@ namespace {
|
||||
{
|
||||
push_button("New Game");
|
||||
Position::init_piece_square_tables();
|
||||
RootPosition.from_fen(StartPosition);
|
||||
RootPosition.from_fen(StartPositionFEN);
|
||||
}
|
||||
else if (token == "isready")
|
||||
cout << "readyok" << endl;
|
||||
@@ -149,9 +149,9 @@ namespace {
|
||||
else if (token == "eval")
|
||||
{
|
||||
EvalInfo ei;
|
||||
cout << "Incremental mg: " << mg_value(RootPosition.value())
|
||||
cout << "Incremental mg: " << mg_value(RootPosition.value())
|
||||
<< "\nIncremental eg: " << eg_value(RootPosition.value())
|
||||
<< "\nFull eval: " << evaluate(RootPosition, ei) << endl;
|
||||
<< "\nFull eval: " << evaluate(RootPosition, ei) << endl;
|
||||
}
|
||||
else if (token == "key")
|
||||
cout << "key: " << hex << RootPosition.get_key()
|
||||
@@ -180,7 +180,7 @@ namespace {
|
||||
return;
|
||||
|
||||
if (token == "startpos")
|
||||
RootPosition.from_fen(StartPosition);
|
||||
RootPosition.from_fen(StartPositionFEN);
|
||||
else if (token == "fen")
|
||||
{
|
||||
string fen;
|
||||
@@ -209,7 +209,7 @@ namespace {
|
||||
RootPosition.reset_game_ply();
|
||||
}
|
||||
// Our StateInfo st is about going out of scope so copy
|
||||
// its content inside RootPosition before they disappear.
|
||||
// its content inside RootPosition before it disappears.
|
||||
RootPosition.detach();
|
||||
}
|
||||
}
|
||||
@@ -300,8 +300,8 @@ namespace {
|
||||
|
||||
assert(RootPosition.is_ok());
|
||||
|
||||
return think(RootPosition, infinite, ponder, RootPosition.side_to_move(),
|
||||
time, inc, movesToGo, depth, nodes, moveTime, searchMoves);
|
||||
return think(RootPosition, infinite, ponder, time, inc, movesToGo,
|
||||
depth, nodes, moveTime, searchMoves);
|
||||
}
|
||||
|
||||
void perft(UCIInputParser& uip) {
|
||||
|
||||
Reference in New Issue
Block a user