mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Assorted cleanups
- fix naming convention for `workingDirectory` - use type alias for `EvalFiles` everywhere - move `ponderMode` into `LimitsType` - move limits parsing into standalone static function closes https://github.com/official-stockfish/Stockfish/pull/5098 No functional change
This commit is contained in:
15
src/uci.cpp
15
src/uci.cpp
@@ -175,11 +175,9 @@ void UCI::loop() {
|
||||
} while (token != "quit" && cli.argc == 1); // The command-line arguments are one-shot
|
||||
}
|
||||
|
||||
void UCI::go(Position& pos, std::istringstream& is, StateListPtr& states) {
|
||||
|
||||
Search::LimitsType UCI::parse_limits(const Position& pos, std::istream& is) {
|
||||
Search::LimitsType limits;
|
||||
std::string token;
|
||||
bool ponderMode = false;
|
||||
|
||||
limits.startTime = now(); // The search starts as early as possible
|
||||
|
||||
@@ -211,7 +209,14 @@ void UCI::go(Position& pos, std::istringstream& is, StateListPtr& states) {
|
||||
else if (token == "infinite")
|
||||
limits.infinite = 1;
|
||||
else if (token == "ponder")
|
||||
ponderMode = true;
|
||||
limits.ponderMode = true;
|
||||
|
||||
return limits;
|
||||
}
|
||||
|
||||
void UCI::go(Position& pos, std::istringstream& is, StateListPtr& states) {
|
||||
|
||||
Search::LimitsType limits = parse_limits(pos, is);
|
||||
|
||||
Eval::NNUE::verify(options, evalFiles);
|
||||
|
||||
@@ -221,7 +226,7 @@ void UCI::go(Position& pos, std::istringstream& is, StateListPtr& states) {
|
||||
return;
|
||||
}
|
||||
|
||||
threads.start_thinking(options, pos, states, limits, ponderMode);
|
||||
threads.start_thinking(options, pos, states, limits);
|
||||
}
|
||||
|
||||
void UCI::bench(Position& pos, std::istream& args, StateListPtr& states) {
|
||||
|
||||
Reference in New Issue
Block a user