From f647ff4b30d372f0aa3e2a2174f8a9c3b03a918e Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 12 Dec 2024 11:30:15 +0100 Subject: [PATCH] don't spread huge arrays, use insertInto to avoid runtime failure https://github.com/microsoft/vscode/issues/235889 --- src/vs/base/browser/ui/tree/abstractTree.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 64efdcaabea15..38570ae882de3 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -20,7 +20,7 @@ import { IToggleStyles, Toggle, unthemedToggleStyles } from '../toggle/toggle.js import { getVisibleState, isFilterResult } from './indexTreeModel.js'; import { ICollapseStateChangeEvent, ITreeContextMenuEvent, ITreeDragAndDrop, ITreeEvent, ITreeFilter, ITreeModel, ITreeModelSpliceEvent, ITreeMouseEvent, ITreeNavigator, ITreeNode, ITreeRenderer, TreeDragOverBubble, TreeError, TreeFilterResult, TreeMouseEventTarget, TreeVisibility } from './tree.js'; import { Action } from '../../../common/actions.js'; -import { distinct, equals, range } from '../../../common/arrays.js'; +import { distinct, equals, insertInto, range } from '../../../common/arrays.js'; import { Delayer, disposableTimeout, timeout } from '../../../common/async.js'; import { Codicon } from '../../../common/codicons.js'; import { ThemeIcon } from '../../../common/themables.js'; @@ -3089,7 +3089,7 @@ export abstract class AbstractTree implements IDisposable state.expanded[getId(node.element)] = node.collapsed ? 0 : 1; } - queue.push(...node.children); + insertInto(queue, queue.length, node.children); } return state;