+/// Position::init_new_state() copies from the current state the fields
+/// that will be updated incrementally, skips the fields, like bitboards
+/// that will be recalculated form scratch anyway.
+
+void Position::init_new_state(StateInfo& newSt) {
+
+ newSt.key = st->key;
+ newSt.pawnKey = st->pawnKey;
+ newSt.materialKey = st->materialKey;
+ newSt.castleRights = st->castleRights;
+ newSt.rule50 = st->rule50;
+ newSt.epSquare = st->epSquare;
+ newSt.mgValue = st->mgValue;
+ newSt.egValue = st->egValue;
+ newSt.capture = NO_PIECE_TYPE;
+ newSt.previous = st;
+}
+
+