From b020ec56ff88233a2dfbfce287e53dd565b5dbdc Mon Sep 17 00:00:00 2001 From: Calcitem Date: Thu, 1 Oct 2020 16:58:58 +0800 Subject: [PATCH] =?UTF-8?q?position:=20=E7=AE=80=E5=8C=96=20update=5Fkey?= =?UTF-8?q?=5Fmisc()=20=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/position.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }