We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23da0ab commit 1408109Copy full SHA for 1408109
src/server/scriptVersionCache.ts
@@ -531,16 +531,12 @@ namespace ts.server {
531
const interiorNode = interiorNodes[i] = new LineNode();
532
let charCount = 0;
533
let lineCount = 0;
534
- for (let j = 0; j < lineCollectionCapacity; j++) {
535
- if (nodeIndex >= nodes.length) {
536
- break;
537
- }
538
-
+ const end = Math.min(nodeIndex + lineCollectionCapacity, nodes.length);
+ for (; nodeIndex < end; nodeIndex++) {
539
const node = nodes[nodeIndex];
540
interiorNode.add(node);
541
charCount += node.charCount();
542
lineCount += node.lineCount();
543
- nodeIndex++;
544
}
545
interiorNode.totalChars = charCount;
546
interiorNode.totalLines = lineCount;
0 commit comments