From 3527a42063c3fc44fdaf85cd9ca0a81013fc17a7 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 6 Dec 2011 14:18:04 +0100 Subject: [PATCH] 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 --- src/search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2