Optimisations for history, pgn and getComments #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
. 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.