]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Remove a small redundancy in DisplayLine.
[remoteglot] / www / js / remoteglot.js
index 594759157e5d1fa664fe146c824a56f6c5222c37..6c220f43cac9dbb2462c12678f02f18304c64025 100644 (file)
@@ -175,8 +175,6 @@ let display_fen = null;
 /** @typedef {{
  *    start_fen: string,
  *    pv: Array.<string>,
- *    move_num: number,
- *    toplay: string,
  *    scores: Array<{first_move: number, score: Object}>,
  *    start_display_move_num: number
  * }}
@@ -715,8 +713,6 @@ function add_pv(start_fen, pv, scores, start_display_move_num, opt_limit, opt_sh
        display_lines.push({
                start_fen: start_fen,
                pv: pv,
-               move_num: find_move_num(start_fen),
-               toplay: find_toplay(start_fen),
                scores: scores,
                start_display_move_num: start_display_move_num
        });
@@ -740,8 +736,8 @@ function add_pv(start_fen, pv, scores, start_display_move_num, opt_limit, opt_sh
 function print_pv(line_num, splicepos, opt_limit, opt_showlast) {
        let display_line = display_lines[line_num];
        let pv = display_line.pv;
-       let move_num = display_line.move_num;
-       let toplay = display_line.toplay;
+       let move_num = find_move_num(display_line.start_fen);
+       let toplay = find_toplay(display_line.start_fen);
 
        // Truncate PV at the start if needed.
        let start_display_move_num = display_line.start_display_move_num;