X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=052176cdc2c9b11ee3c5605815ff742be4f50679;hb=81cd417b4584b0e3830940c5cb122c898afde08a;hp=ee1128043f32f9b94f20f1722f2df55bc074ae5b;hpb=a44c5cf4f77b05a0385c127b7c26cf086a73120e;p=stockfish diff --git a/src/benchmark.cpp b/src/benchmark.cpp index ee112804..052176cd 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -28,7 +28,7 @@ using namespace std; -static const string Defaults[] = { +static const char* Defaults[] = { "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 10", "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 11", @@ -59,7 +59,7 @@ static const string Defaults[] = { void benchmark(int argc, char* argv[]) { - std::vector searchMoves(1, MOVE_NONE); + vector searchMoves(1, MOVE_NONE); vector fenList; Search::LimitsType limits; int64_t totalNodes; @@ -85,7 +85,10 @@ void benchmark(int argc, char* argv[]) { limits.maxDepth = atoi(valStr.c_str()); // Do we need to load positions from a given FEN file? - if (fenFile != "default") + if (fenFile == "default") + for (int i = 0; *Defaults[i]; i++) + fenList.push_back(Defaults[i]); + else { string fen; ifstream f(fenFile.c_str()); @@ -102,9 +105,6 @@ void benchmark(int argc, char* argv[]) { f.close(); } - else // Load default positions - for (int i = 0; !Defaults[i].empty(); i++) - fenList.push_back(Defaults[i]); // Ok, let's start the benchmark ! totalNodes = 0;