mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Improve readability of evaluation functions
This patch puts the evaluation helper functions inside EvalInfo struct, which simplifies a bit their signature and (most importantly, IMHO) makes their C++ code much cleaner and simpler to read (by removing the "ei." qualifiers all around in evaluate.cpp). Also rename the EvalInfo struct into Evaluation class to get a natural invocation v = Evaluation(p).value() to evaluation position p. The downside is an increase of 20 lines in evaluate.cpp (for the prototypes of the helper functions). The upsides are better readability and a speed-up of 0.6% (by generating all the helpers for the NO_TRACE case together, which helps the instruction cache). No functional change Closes #1135
This commit is contained in:
@@ -33,7 +33,6 @@ const Value Tempo = Value(20); // Must be visible to search
|
||||
|
||||
std::string trace(const Position& pos);
|
||||
|
||||
template<bool DoTrace = false>
|
||||
Value evaluate(const Position& pos);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user