]> git.sesse.net Git - stockfish/commitdiff
Code clean-up
authorStéphane Nicolet <cassio@free.fr>
Wed, 25 Jul 2018 16:31:02 +0000 (18:31 +0200)
committerStéphane Nicolet <cassio@free.fr>
Wed, 25 Jul 2018 16:31:02 +0000 (18:31 +0200)
This patch implements some idea by Alain Savard and Mike Whiteley taken from the perpertual renaming/reformatting thread.

This is a pure code cleaning patch (so no change in functionality), but I use it as a pretext to correct the bogus bench number that I introduced in the previous commit.

Bench: 4413383

src/evaluate.cpp
src/misc.cpp

index 76ffcf039a65622a978520c0353e493801bcff59..7309f9f31a6c5e7c7de25bdaac4e75394f9f9f57 100644 (file)
@@ -551,7 +551,6 @@ namespace {
                 score += ThreatByRank * (int)relative_rank(Them, s);
         }
 
-        // Bonus for king attacks on pawns or pieces which are not pawn-defended
         if (weak & attackedBy[Us][KING])
             score += ThreatByKing;
 
@@ -576,7 +575,7 @@ namespace {
     b  = shift<Up>(pos.pieces(Us, PAWN)) & ~pos.pieces();
     b |= shift<Up>(b & TRank3BB) & ~pos.pieces();
 
-    // Keep only the squares which are not completely unsafe
+    // Keep only the squares which are relatively safe
     b &= ~attackedBy[Them][PAWN]
         & (attackedBy[Us][ALL_PIECES] | ~attackedBy[Them][ALL_PIECES]);
 
index e6a29af78366684a28a3056e4f5a8f4c01964e66..5572bc91c8ed57c0d15367e7e8fc24da57453e5e 100644 (file)
@@ -224,11 +224,11 @@ void bindThisThread(size_t) {}
 
 #else
 
-/// get_group() retrieves logical processor information using Windows specific
+/// best_group() retrieves logical processor information using Windows specific
 /// API and returns the best group id for the thread with index idx. Original
 /// code from Texel by Peter Österlund.
 
-int get_group(size_t idx) {
+int best_group(size_t idx) {
 
   int threads = 0;
   int nodes = 0;
@@ -299,7 +299,7 @@ int get_group(size_t idx) {
 void bindThisThread(size_t idx) {
 
   // Use only local variables to be thread-safe
-  int group = get_group(idx);
+  int group = best_group(idx);
 
   if (group == -1)
       return;