mirror of
https://github.com/sockspls/badfish
synced 2025-07-13 12:39:16 +00:00
Simplify wait_for_stop_or_ponderhit()
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
8d4caebabe
commit
f5b8db7a1e
1 changed files with 6 additions and 17 deletions
|
@ -1944,10 +1944,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
// We are line oriented, don't read single chars
|
// We are line oriented, don't read single chars
|
||||||
std::string command;
|
std::string command;
|
||||||
|
|
||||||
if (!std::getline(std::cin, command))
|
if (!std::getline(std::cin, command) || command == "quit")
|
||||||
command = "quit";
|
|
||||||
|
|
||||||
if (command == "quit")
|
|
||||||
{
|
{
|
||||||
// Quit the program as soon as possible
|
// Quit the program as soon as possible
|
||||||
Pondering = false;
|
Pondering = false;
|
||||||
|
@ -2025,20 +2022,12 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
std::string command;
|
std::string command;
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
// Wait for a command from stdin
|
// Wait for a command from stdin
|
||||||
if (!std::getline(std::cin, command))
|
while ( std::getline(std::cin, command)
|
||||||
command = "quit";
|
&& command != "ponderhit" && command != "stop" && command != "quit") {};
|
||||||
|
|
||||||
if (command == "quit")
|
if (command != "ponderhit" && command != "stop")
|
||||||
{
|
QuitRequest = true; // Must be "quit" or getline() returned false
|
||||||
QuitRequest = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (command == "ponderhit" || command == "stop")
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue