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:
Marco Costalba
2010-07-15 17:05:56 +02:00
parent a98dee7835
commit b6ab610e2f
7 changed files with 22 additions and 26 deletions

View File

@@ -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) {