Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There seems to be a problem with the source code #366

Open
onepeopleheart opened this issue Mar 24, 2023 · 0 comments
Open

There seems to be a problem with the source code #366

onepeopleheart opened this issue Mar 24, 2023 · 0 comments

Comments

@onepeopleheart
Copy link

First of all, I am a netizen from abroad. Your tool is very convenient. Thank you very much.
I found that in NodePort.cs, the code for AddConnections and MoveConnections was compared, and I felt a bit similar.
According to the comments, my understanding of the method of MoveConnections is to transfer all of its own connections to the targetPort and clear all of its own.
By the way, I'm using version 1.7.
It seems consistent within the for loop?

`

    /// <summary> Copy all connections pointing to a node and add them to this one </summary>
    public void AddConnections(NodePort targetPort) {
        int connectionCount = targetPort.ConnectionCount;
        for (int i = 0; i < connectionCount; i++) {
            PortConnection connection = targetPort.connections[i];
            NodePort otherPort = connection.Port;
            Connect(otherPort);
        }
    }

    /// <summary> Move all connections pointing to this node, to another node </summary>
    public void MoveConnections(NodePort targetPort) {
        int connectionCount = connections.Count;

        // Add connections to target port
        for (int i = 0; i < connectionCount; i++) {
            PortConnection connection = targetPort.connections[i];
            NodePort otherPort = connection.Port;
            Connect(otherPort);
        }
        ClearConnections();
    }

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant