Skip to content

Commit a362c86

Browse files
committed
simpler nodeHasInputConnections implementation
1 parent 29c896c commit a362c86

File tree

1 file changed

+1
-3
lines changed
  • src/main/java/com/marginallyclever/nodegraphcore

1 file changed

+1
-3
lines changed

src/main/java/com/marginallyclever/nodegraphcore/Graph.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ public void removeConnectionsToNode(Node n) {
157157
*/
158158
public boolean nodeHasInputConnections(Node node) {
159159
for(Connection c : connections) {
160-
for(int i = 0; i<node.getNumPorts(); ++i) {
161-
if(c.getInput() == node.getPort(i)) return true;
162-
}
160+
if(c.getTo() == node) return true;
163161
}
164162
return false;
165163
}

0 commit comments

Comments
 (0)