Skip to content

Commit

Permalink
Fix Hash in bench
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lucasart committed Aug 7, 2014
1 parent 9da0155 commit 6044f25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/benchmark.cpp
Expand Up @@ -82,7 +82,7 @@ void benchmark(const Position& current, istream& is) {
vector<string> fens;

// 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 limit = (is >> token) ? token : "13";
string fenFile = (is >> token) ? token : "default";
Expand Down

0 comments on commit 6044f25

Please sign in to comment.