]> git.sesse.net Git - stockfish/commit
Improve readability of evaluation functions
authorsnicolet <cassio@free.fr>
Wed, 21 Jun 2017 21:01:59 +0000 (14:01 -0700)
committerJoona Kiiski <joona@zoox.com>
Wed, 21 Jun 2017 21:01:59 +0000 (14:01 -0700)
commit612d93234bdfbac77bba9c7a5756a92b76181ddf
treee52d13c9d505c04be17dad6d9cd6b5585842d2f5
parent0149a4c3d667ab6b7e37f88a597881e51be5f4f1
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
src/evaluate.cpp
src/evaluate.h