summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a6d1342)
KILLER_MAX in search.h is quite pointless, because
we already hardcode this to 2 in MovePicker anyway.
By hard-coding this to 2 we can keep code simpler.
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
// SearchStack::initKillers() initializes killers for a search stack entry
void SearchStack::initKillers() {
// SearchStack::initKillers() initializes killers for a search stack entry
void SearchStack::initKillers() {
- mateKiller = MOVE_NONE;
- for (int i = 0; i < KILLER_MAX; i++)
- killers[i] = MOVE_NONE;
+ killers[0] = killers[1] = mateKiller = MOVE_NONE;
bool move_is_killer(Move m, SearchStack* ss) {
bool move_is_killer(Move m, SearchStack* ss) {
- const Move* k = ss->killers;
- for (int i = 0; i < KILLER_MAX; i++, k++)
- if (*k == m)
- return true;
+ if (ss->killers[0] == m || ss->killers[1] == m)
+ return true;
if (m == ss->killers[0])
return;
if (m == ss->killers[0])
return;
- for (int i = KILLER_MAX - 1; i > 0; i--)
- ss->killers[i] = ss->killers[i - 1];
-
+ ss->killers[1] = ss->killers[0];
const int PLY_MAX = 100;
const int PLY_MAX_PLUS_2 = 102;
const int PLY_MAX = 100;
const int PLY_MAX_PLUS_2 = 102;
-const int KILLER_MAX = 2;
Move threatMove;
Move excludedMove;
Move bestMove;
Move threatMove;
Move excludedMove;
Move bestMove;
- Move killers[KILLER_MAX];
Depth reduction;
Value eval;
bool skipNullMove;
Depth reduction;
Value eval;
bool skipNullMove;