summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ccf21f5)
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.
Rank rkUs, rkThem;
File kf = file_of(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++)
{
for (int f = kf - 1; f <= kf + 1; f++)
{