Reformat SEE to better document the function

This is one of the most difficult to understand but also
most important and speed critical functions of SF.

This patch rewrites some part of it to hopefully
make it clearer and drop some redundant variables
in the process.

Same speed than master (or even a bit more).

Thanks to Chris Cain for useful feedback.

No functional change.
This commit is contained in:
Marco Costalba
2018-02-23 22:02:10 +01:00
committed by Stéphane Nicolet
parent 52f92d05a9
commit a09eee5798
4 changed files with 59 additions and 59 deletions

View File

@@ -510,9 +510,9 @@ namespace {
template<Tracing T> template<Color Us>
Score Evaluation<T>::threats() const {
const Color Them = (Us == WHITE ? BLACK : WHITE);
const Direction Up = (Us == WHITE ? NORTH : SOUTH);
const Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);
const Color Them = (Us == WHITE ? BLACK : WHITE);
const Direction Up = (Us == WHITE ? NORTH : SOUTH);
const Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);
Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safeThreats;
Score score = SCORE_ZERO;