mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Code style in search.cpp
It does not appear to be not necessary or advantageous to conditionally initialize kingRing[Us] or kingAttackersCount[Them], so the 'else' can be removed. STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 22873 W: 4923 L: 4804 D: 13146 http://tests.stockfishchess.org/tests/view/5be9a8270ebc595e0ae33c7e No functional change
This commit is contained in:
parent
4350a66ffa
commit
0e508f30bb
1 changed files with 1 additions and 2 deletions
|
@ -257,6 +257,7 @@ namespace {
|
||||||
attackedBy[Us][PAWN] = pe->pawn_attacks(Us);
|
attackedBy[Us][PAWN] = pe->pawn_attacks(Us);
|
||||||
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
|
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
|
||||||
attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN];
|
attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN];
|
||||||
|
kingRing[Us] = kingAttackersCount[Them] = 0;
|
||||||
|
|
||||||
// Init our king safety tables only if we are going to use them
|
// Init our king safety tables only if we are going to use them
|
||||||
if (pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg)
|
if (pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg)
|
||||||
|
@ -274,8 +275,6 @@ namespace {
|
||||||
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
|
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
|
||||||
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
|
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
kingRing[Us] = kingAttackersCount[Them] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue