1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Fix Hash in bench

The compiler tries to cast Options["Hash"] into a string, using:

Option::operator std::string() const {
  assert(type == "string");
  return currentValue;
}

And, as expected, the assert() fails.

std::to_string() would be the right solution, but it's C++11. And using a stringstream is too much code to
achieve so little. Let's keep it the way it was: hardcoded (ie. default hash defined in two places).

No functional change.
This commit is contained in:
lucasart 2014-08-07 18:51:07 +08:00
parent 9da015517c
commit 6044f25d71

View file

@ -82,7 +82,7 @@ void benchmark(const Position& current, istream& is) {
vector<string> fens; vector<string> fens;
// Assign default values to missing arguments // Assign default values to missing arguments
string ttSize = (is >> token) ? token : Options["Hash"]; string ttSize = (is >> token) ? token : "16";
string threads = (is >> token) ? token : "1"; string threads = (is >> token) ? token : "1";
string limit = (is >> token) ? token : "13"; string limit = (is >> token) ? token : "13";
string fenFile = (is >> token) ? token : "default"; string fenFile = (is >> token) ? token : "default";