From 79f393084af73655c869af126281bb2a7c2cc396 Mon Sep 17 00:00:00 2001 From: mstembera Date: Mon, 16 Nov 2015 15:39:11 -0800 Subject: [PATCH] Clean up RootMove less operator This is used by std::stable_sort() to sort moves from highest score to lowest score. 1) The comment is incorrect since highest to lowest means descending. 2) It's more natural to implement a less operator using another less operator rather than a greater operator. No functional change. Resolves #504 --- src/search.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.h b/src/search.h index 96c0a2d1..d755f1c2 100644 --- a/src/search.h +++ b/src/search.h @@ -56,7 +56,7 @@ struct RootMove { explicit RootMove(Move m) : pv(1, m) {} - bool operator<(const RootMove& m) const { return score > m.score; } // Ascending sort + bool operator<(const RootMove& m) const { return m.score < score; } // Descending sort bool operator==(const Move& m) const { return pv[0] == m; } void insert_pv_in_tt(Position& pos); bool extract_ponder_from_tt(Position& pos); -- 2.39.2