From: Marco Costalba Date: Tue, 6 Dec 2011 13:18:04 +0000 (+0100) Subject: Prefer empty() to size() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=3527a42063c3fc44fdaf85cd9ca0a81013fc17a7 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 --- diff --git a/src/search.cpp b/src/search.cpp index 77acd89e..3cae0e3f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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;