From cc1ae37240e95538d325162c9843b1d91d1c9b59 Mon Sep 17 00:00:00 2001 From: mayuntian Date: Thu, 13 Aug 2020 16:42:52 +0800 Subject: [PATCH] fix Disconnect bug --- Scripts/NodePort.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Scripts/NodePort.cs b/Scripts/NodePort.cs index b2f1ad1..692e63f 100644 --- a/Scripts/NodePort.cs +++ b/Scripts/NodePort.cs @@ -307,11 +307,7 @@ namespace XNode { // Remove the other ports connection to this port NodePort otherPort = connections[i].Port; if (otherPort != null) { - for (int k = 0; k < otherPort.connections.Count; k++) { - if (otherPort.connections[k].Port == this) { - otherPort.connections.RemoveAt(i); - } - } + otherPort.connections.RemoveAll(it => { return it.Port == this; }); } // Remove this ports connection to the other connections.RemoveAt(i);