mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08: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:
@@ -507,7 +507,7 @@ namespace {
|
||||
Rml.init(pos, rootMoves);
|
||||
|
||||
// Handle special case of searching on a mate/stalemate position
|
||||
if (!Rml.size())
|
||||
if (Rml.empty())
|
||||
{
|
||||
cout << "info" << depth_to_uci(DEPTH_ZERO)
|
||||
<< score_to_uci(pos.in_check() ? -VALUE_MATE : VALUE_DRAW, alpha, beta) << endl;
|
||||
|
||||
Reference in New Issue
Block a user