]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Avoid unnecessary string copies
[stockfish] / src / uci.cpp
index c49b9b78a4985123ac125cd63142b5b456e5bb1e..30c1fa0cce0cfc448dc4cf96ae78684c324f4a0e 100644 (file)
@@ -22,6 +22,7 @@
 #include <sstream>
 #include <string>
 
+#include "benchmark.h"
 #include "evaluate.h"
 #include "movegen.h"
 #include "position.h"
@@ -36,8 +37,6 @@ using namespace std;
 
 namespace Stockfish {
 
-vector<string> setup_bench(const Position&, istream&);
-
 namespace {
 
   // FEN string for the initial position in standard chess
@@ -161,7 +160,7 @@ namespace {
     uint64_t num, nodes = 0, cnt = 1;
 
     vector<string> list = setup_bench(pos, args);
-    num = count_if(list.begin(), list.end(), [](string s) { return s.find("go ") == 0 || s.find("eval") == 0; });
+    num = count_if(list.begin(), list.end(), [](const string& s) { return s.find("go ") == 0 || s.find("eval") == 0; });
 
     TimePoint elapsed = now();