key: 不再异或 pieceCountInHand 和 ACTION_REMOVE

两者并不会影响到 value 的计算,故可移除。
而 pieceCountNeedRemove 需要保留,因为会影响 value 计算。
This commit is contained in:
Calcitem 2020-10-01 11:22:44 +08:00
parent 0e54688853
commit 032a514c5a
1 changed files with 4 additions and 1 deletions

View File

@ -1265,12 +1265,15 @@ Key Position::update_key_misc()
}
#endif
#if 0
if (action == ACTION_REMOVE) {
hi |= 1U << 1;
}
hi |= static_cast<Key>(pieceCountNeedRemove) << 2;
hi |= static_cast<Key>(pieceCountInHand[BLACK]) << 4; // TODO: may use phase is also OK?
#endif
hi |= static_cast<Key>(pieceCountNeedRemove) << 2;
st->key = st->key | (hi << (CHAR_BIT * sizeof(Key) - KEY_MISC_BIT));