Skip to content

Commit 43f0785

Browse files
authored
Avoid extra call to Iterable.map (microsoft#163902)
We loop through the nodes, so can simply do the map inside of the loop instead of making this extra call
1 parent 845f524 commit 43f0785

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/base/browser/ui/tree/indexTreeModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,12 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi
526526

527527
const childElements = treeElement.children || Iterable.empty();
528528
const childRevealed = revealed && visibility !== TreeVisibility.Hidden && !node.collapsed;
529-
const childNodes = Iterable.map(childElements, el => this.createTreeNode(el, node, visibility, childRevealed, treeListElements, onDidCreateNode));
530529

531530
let visibleChildrenCount = 0;
532531
let renderNodeCount = 1;
533532

534-
for (const child of childNodes) {
533+
for (const el of childElements) {
534+
const child = this.createTreeNode(el, node, visibility, childRevealed, treeListElements, onDidCreateNode);
535535
node.children.push(child);
536536
renderNodeCount += child.renderNodeCount;
537537

0 commit comments

Comments
 (0)