Use a std::vector to store searchMoves

A std::set (that is a rb_tree) seems really
overkill to store at most a handful of moves
and nothing in the common case.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-04-01 12:26:14 +01:00
parent 72641dcaae
commit 7eb6a488ad
5 changed files with 10 additions and 11 deletions

View File

@@ -212,7 +212,7 @@ namespace {
void go(Position& pos, istringstream& is) {
Search::LimitsType limits;
std::set<Move> searchMoves;
vector<Move> searchMoves;
string token;
while (is >> token)
@@ -239,7 +239,7 @@ namespace {
limits.ponder = true;
else if (token == "searchmoves")
while (is >> token)
searchMoves.insert(move_from_uci(pos, token));
searchMoves.push_back(move_from_uci(pos, token));
}
Threads.start_searching(pos, limits, searchMoves);
@@ -263,8 +263,8 @@ namespace {
int e = time.elapsed();
std::cout << "\nNodes " << n
<< "\nTime (ms) " << e
<< "\nNodes/second " << int(n / (e / 1000.0)) << std::endl;
cout << "\nNodes " << n
<< "\nTime (ms) " << e
<< "\nNodes/second " << int(n / (e / 1000.0)) << endl;
}
}