From 9ccc115bd8097f2f1847ec137ed59eebfe436529 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sat, 2 Jan 2021 13:15:43 +0800 Subject: [PATCH] position: REMOVE unused newSt and repetition code --- src/position.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 72b40d94..e901035a 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -399,20 +399,6 @@ bool Position::legal(Move m) const void Position::do_move(Move m) { -#if 0 - assert(is_ok(m)); - assert(&newSt != st); - - thisThread->nodes.fetch_add(1, std::memory_order_relaxed); - - // Copy some fields of the old state to our new StateInfo object except the - // ones which are going to be recalculated from scratch anyway and then switch - // our state pointer to point to the new (ready to be updated) state. - std::memcpy(&newSt, st, offsetof(StateInfo, key)); - newSt.previous = st; - st = &newSt; -#endif - bool ret = false; MoveType mt = type_of(m); @@ -444,26 +430,6 @@ void Position::do_move(Move m) ++st.pliesFromNull; move = m; - -#if 0 - // Calculate the repetition info. It is the ply distance from the previous - // occurrence of the same position, negative in the 3-fold case, or zero - // if the position was not repeated. - st.repetition = 0; - int end = std::min(st.rule50, st.pliesFromNull); - if (end >= 4) { - StateInfo *stp = st.previous->previous; - for (int i = 4; i <= end; i += 2) { - stp = stp->previous->previous; - if (stp->key == st.key) { - st.repetition = stp->repetition ? -i : i; - break; - } - } - } - - assert(pos_is_ok()); -#endif }