Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik authored Dec 19, 2024
1 parent 73f6109 commit da49a70
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/ckeditor5-engine/src/view/treewalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,13 @@ export default class TreeWalker implements IterableIterator<TreeWalkerValue> {
}

/**
* Moves treewalker {@link #position} to provided `position`. Treewalker will
* Moves tree walker {@link #position} to provided `position`. Tree walker will
* continue traversing from that position.
*
* Note: in contrary to {@link ~TreeWalker#skip}, this method does not iterate over the nodes along the way.
* It simply sets the current tree walker position to a new one.
* From the performance standpoint, it is better to use {@link ~TreeWalker#jumpTo} rather than {@link ~TreeWalker#skip}.
*
* If the provided position is before the start boundary, the position will be
* set to the start boundary. If the provided position is after the end boundary,
* the position will be set to the end boundary.
Expand All @@ -177,7 +181,7 @@ export default class TreeWalker implements IterableIterator<TreeWalkerValue> {
position = this.boundaries!.end;
}

this._position = position;
this._position = position.clone();
}

/**
Expand Down

0 comments on commit da49a70

Please sign in to comment.