mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Avoid a tricky line in shelter_storm()
kf = (kf == FILE_A) ? kf++ : .... is tricky becuase kf is updated twice and it happens to do the right thing just by accident. Rewrite in a better way. Spotted by pdimov No functional change.
This commit is contained in:
parent
ccf21f5595
commit
dbd28bc7f8
1 changed files with 1 additions and 1 deletions
|
@ -231,7 +231,7 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
|
|||
Rank rkUs, rkThem;
|
||||
File kf = file_of(ksq);
|
||||
|
||||
kf = (kf == FILE_A) ? kf++ : (kf == FILE_H) ? kf-- : kf;
|
||||
kf = (kf == FILE_A) ? FILE_B : (kf == FILE_H) ? FILE_G : kf;
|
||||
|
||||
for (int f = kf - 1; f <= kf + 1; f++)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue