Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 9dc931a

Browse files
Simplifying logic
1 parent 03d85a8 commit 9dc931a

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -481,34 +481,14 @@ protected override Texture2D GetNodeIcon(TreeNode node)
481481

482482
public void UpdateIcons(Texture2D activeBranchIcon, Texture2D branchIcon, Texture2D folderIcon, Texture2D rootFolderIcon)
483483
{
484-
var localsLoaded = false;
485-
486-
if (ActiveNodeIcon == null)
484+
var needsLoad = ActiveNodeIcon == null || NodeIcon == null || FolderIcon == null || RootFolderIcon == null;
485+
if (needsLoad)
487486
{
488-
localsLoaded = true;
489487
ActiveNodeIcon = activeBranchIcon;
490-
}
491-
492-
if (NodeIcon == null)
493-
{
494-
localsLoaded = true;
495488
NodeIcon = branchIcon;
496-
}
497-
498-
if (FolderIcon == null)
499-
{
500-
localsLoaded = true;
501489
FolderIcon = folderIcon;
502-
}
503-
504-
if (RootFolderIcon == null)
505-
{
506-
localsLoaded = true;
507490
RootFolderIcon = rootFolderIcon;
508-
}
509491

510-
if (localsLoaded)
511-
{
512492
LoadNodeIcons();
513493
}
514494
}

0 commit comments

Comments
 (0)