Skip to content

Commit ae98927

Browse files
committed
Code clean-up
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
1 parent c4c2e08 commit ae98927

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/evaluate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ namespace {
551551
score += ThreatByRank * (int)relative_rank(Them, s);
552552
}
553553

554-
// Bonus for king attacks on pawns or pieces which are not pawn-defended
555554
if (weak & attackedBy[Us][KING])
556555
score += ThreatByKing;
557556

@@ -576,7 +575,7 @@ namespace {
576575
b = shift<Up>(pos.pieces(Us, PAWN)) & ~pos.pieces();
577576
b |= shift<Up>(b & TRank3BB) & ~pos.pieces();
578577

579-
// Keep only the squares which are not completely unsafe
578+
// Keep only the squares which are relatively safe
580579
b &= ~attackedBy[Them][PAWN]
581580
& (attackedBy[Us][ALL_PIECES] | ~attackedBy[Them][ALL_PIECES]);
582581

src/misc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ void bindThisThread(size_t) {}
224224

225225
#else
226226

227-
/// get_group() retrieves logical processor information using Windows specific
227+
/// best_group() retrieves logical processor information using Windows specific
228228
/// API and returns the best group id for the thread with index idx. Original
229229
/// code from Texel by Peter Österlund.
230230

231-
int get_group(size_t idx) {
231+
int best_group(size_t idx) {
232232

233233
int threads = 0;
234234
int nodes = 0;
@@ -299,7 +299,7 @@ int get_group(size_t idx) {
299299
void bindThisThread(size_t idx) {
300300

301301
// Use only local variables to be thread-safe
302-
int group = get_group(idx);
302+
int group = best_group(idx);
303303

304304
if (group == -1)
305305
return;

0 commit comments

Comments
 (0)