Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Epica3055 authored and Tanya-Solyanik committed May 23, 2024
1 parent c7c7953 commit 247e021
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/System.Windows.Forms/src/System/Windows/Forms/TreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal TreeNodeImageIndexer StateImageIndexer
internal int index; // our index into our parents child array
internal int childCount;
// this array should not be optimized as a list because we are inserting into the middle of it, not appending.
internal TreeNode[] children = [];
internal TreeNode[] children;
internal TreeNode parent;
internal TreeView treeView;
private bool expandOnRealization;
Expand Down Expand Up @@ -1379,7 +1379,7 @@ internal void Clear()
children[childCount - 1].Remove(true);
}

children = [];
children = null;

if (tv is not null && isBulkOperation)
{
Expand Down Expand Up @@ -1672,7 +1672,7 @@ internal void EnsureCapacity(int num)
size = 4;
}

if (children is null || children.Length == 0)
if (children is null)
{
children = new TreeNode[size];
}
Expand Down

0 comments on commit 247e021

Please sign in to comment.