From babfcc18ceb3a30eecdf4d00a4f42ff03ca10b5b Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 2 Jan 2026 03:21:42 -0800 Subject: Fold: simplify code --- Scripts/Fold/Editor/FoldGraphView.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Scripts/Fold/Editor/FoldGraphView.cs') diff --git a/Scripts/Fold/Editor/FoldGraphView.cs b/Scripts/Fold/Editor/FoldGraphView.cs index 2a94b9f..f77e97b 100644 --- a/Scripts/Fold/Editor/FoldGraphView.cs +++ b/Scripts/Fold/Editor/FoldGraphView.cs @@ -3,6 +3,7 @@ using UnityEditor; using GraphProcessor; using System; using System.Collections.Generic; +using System.Linq; public class FoldGraphView : BaseGraphView { @@ -10,12 +11,8 @@ public class FoldGraphView : BaseGraphView public override IEnumerable<(string path, Type type)> FilterCreateNodeMenuEntries() { - // Only return our subset of nodes - foreach (var nodeMenuItem in NodeProvider.GetNodeMenuEntries(graph)) - { - if (typeof(BaseFoldNode).IsAssignableFrom(nodeMenuItem.type)) - yield return nodeMenuItem; - } + return NodeProvider.GetNodeMenuEntries(graph) + .Where(entry => typeof(BaseFoldNode).IsAssignableFrom(entry.type)); } } -- cgit v1.2.3