position: 简化 update_key_misc() 代码
This commit is contained in:
parent
6e22421d8e
commit
b020ec56ff
|
@ -1257,11 +1257,8 @@ Key Position::update_key_misc()
|
|||
const int KEY_MISC_BIT = 2;
|
||||
|
||||
st->key = st->key << KEY_MISC_BIT >> KEY_MISC_BIT;
|
||||
Key hi = 0;
|
||||
|
||||
hi |= static_cast<Key>(pieceCountNeedRemove);
|
||||
|
||||
st->key = st->key | (hi << (CHAR_BIT * sizeof(Key) - KEY_MISC_BIT));
|
||||
st->key |= static_cast<Key>(pieceCountNeedRemove) << (CHAR_BIT * sizeof(Key) - KEY_MISC_BIT);
|
||||
|
||||
return st->key;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue