DFS with depth (#1451)

This commit is contained in:
Gerard Rovira
2022-03-16 11:41:10 +00:00
committed by acywatson
parent d6d30c30a0
commit 2edef7149d
3 changed files with 44 additions and 26 deletions

View File

@ -130,7 +130,7 @@ function $wrapOverflowedNodes(offset: number): void {
const dfsNodesLength = dfsNodes.length;
let accumulatedLength = 0;
for (let i = 0; i < dfsNodesLength; i += 1) {
const node = dfsNodes[i];
const {node} = dfsNodes[i];
if ($isOverflowNode(node)) {
const previousLength = accumulatedLength;
const nextLength = accumulatedLength + node.getTextContentSize();