Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisations for history, pgn and getComments #421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 24, 2023

  1. Optimisations for history, pgn and getComments

    Improved the efficiency of several methods by including the pretty move in _history. Therefore, the entire game does not need to be replayed whenever the history needs to be iterated just to get the fen/san moves in each position.
    
    Added an optional { pushPretty: false } flag to _makeMove to adjust its behaviour. When provided, the pretty move will not be pushed to the history. This is so that when _makeMove is called only to be immediately followed by an _undoMove (which is a common design pattern throughout the library), the pretty move is not generated unnecessarily (and indeed potentially causing infinite recursion). However, this flag should only be used when the move is not intended to be left on the history.
    gavin-lb committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    0b8ea3b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f90e81 View commit details
    Browse the repository at this point in the history