1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Prefer empty() to size()

As Heinz says:

"Function empty() should have a constant run-time even
 on lousy compilers and you spare the not.

The change is even measurable: + 100-150 nodes/sec. Wow:-)"

Patch from Heinz van Saanen

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-12-06 14:18:04 +01:00
parent 98352a5e84
commit 3527a42063

View file

@ -507,7 +507,7 @@ namespace {
Rml.init(pos, rootMoves); Rml.init(pos, rootMoves);
// Handle special case of searching on a mate/stalemate position // Handle special case of searching on a mate/stalemate position
if (!Rml.size()) if (Rml.empty())
{ {
cout << "info" << depth_to_uci(DEPTH_ZERO) cout << "info" << depth_to_uci(DEPTH_ZERO)
<< score_to_uci(pos.in_check() ? -VALUE_MATE : VALUE_DRAW, alpha, beta) << endl; << score_to_uci(pos.in_check() ? -VALUE_MATE : VALUE_DRAW, alpha, beta) << endl;