Skip to content

Commit

Permalink
don't spread huge arrays, use insertInto to avoid runtime failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Dec 12, 2024
1 parent 0b7b0c3 commit f647ff4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/base/browser/ui/tree/abstractTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -3089,7 +3089,7 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
state.expanded[getId(node.element)] = node.collapsed ? 0 : 1;
}

queue.push(...node.children);
insertInto(queue, queue.length, node.children);
}

return state;
Expand Down

0 comments on commit f647ff4

Please sign in to comment.