-
- if (cmh)
- cmh->update(pos.moved_piece(quiets[i]), to_sq(quiets[i]), -bonus);
-
- if (fmh)
- fmh->update(pos.moved_piece(quiets[i]), to_sq(quiets[i]), -bonus);
-
- if (fmh2)
- fmh2->update(pos.moved_piece(quiets[i]), to_sq(quiets[i]), -bonus);
- }
-
- // Extra penalty for a quiet TT move in previous ply when it gets refuted
- if ((ss-1)->moveCount == 1 && !pos.captured_piece_type())
- {
- if ((ss-2)->counterMoves)
- (ss-2)->counterMoves->update(pos.piece_on(prevSq), prevSq, -bonus - 2 * (depth + 1) / ONE_PLY - 1);
-
- if ((ss-3)->counterMoves)
- (ss-3)->counterMoves->update(pos.piece_on(prevSq), prevSq, -bonus - 2 * (depth + 1) / ONE_PLY - 1);
-
- if ((ss-5)->counterMoves)
- (ss-5)->counterMoves->update(pos.piece_on(prevSq), prevSq, -bonus - 2 * (depth + 1) / ONE_PLY - 1);
+ thisThread->history.update(pos.moved_piece(quiets[i]), to_sq(quiets[i]), -bonus);
+ update_cm_stats(ss, pos.moved_piece(quiets[i]), to_sq(quiets[i]), -bonus);