diff --git a/src/position.cpp b/src/position.cpp index 84b0eb5c..b0560c1c 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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(pieceCountNeedRemove); - - st->key = st->key | (hi << (CHAR_BIT * sizeof(Key) - KEY_MISC_BIT)); + st->key |= static_cast(pieceCountNeedRemove) << (CHAR_BIT * sizeof(Key) - KEY_MISC_BIT); return st->key; }