Always have counterMoves associated

Simplifies away all associated checks, leading to a ~0.5% speedup.
The code now explicitly checks if moves are OK, rather than using nullptr checks.

Verified for no regression:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 32218 W: 5762 L: 5660 D: 20796

No functional change

Closes #1021
This commit is contained in:
Joost VandeVondele
2017-03-08 18:35:23 -08:00
committed by Joona Kiiski
parent cc76524c2e
commit d490bb9973
3 changed files with 26 additions and 29 deletions

View File

@@ -149,9 +149,9 @@ void MovePicker::score<QUIETS>() {
Color c = pos.side_to_move();
for (auto& m : *this)
m.value = (cmh ? (*cmh)[pos.moved_piece(m)][to_sq(m)] : VALUE_ZERO)
+ (fmh ? (*fmh)[pos.moved_piece(m)][to_sq(m)] : VALUE_ZERO)
+ (fmh2 ? (*fmh2)[pos.moved_piece(m)][to_sq(m)] : VALUE_ZERO)
m.value = (*cmh)[pos.moved_piece(m)][to_sq(m)]
+ (*fmh)[pos.moved_piece(m)][to_sq(m)]
+ (*fmh2)[pos.moved_piece(m)][to_sq(m)]
+ history.get(c, m);
}