Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-04-07 08:26:03 +0300
committerHans Goudey <h.goudey@me.com>2021-04-07 08:26:03 +0300
commitfd0a0096dd07c7672d82ca91d5edd5315c2a2c5f (patch)
treeccc0c9ef2401401c86e53149fc06c8a6fd5cf0ae /source/blender/editors/space_node/node_relationships.c
parente0a1a2f49dab57d3e58372a38441b7d49c6e0fe1 (diff)
Cleanup: Various cleanup of node link handling functions
Use LISTBASE_FOREACH macro, rename variables, comment formatting, simplification of logic, etc.
Diffstat (limited to 'source/blender/editors/space_node/node_relationships.c')
-rw-r--r--source/blender/editors/space_node/node_relationships.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 95584847d6e..80601747f2e 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -745,14 +745,11 @@ static void node_link_update_header(bContext *C, bNodeLinkDrag *UNUSED(nldrag))
ED_workspace_status_text(C, header);
}
-static int node_count_links(bNodeTree *ntree, bNodeSocket *sock)
+static int node_count_links(const bNodeTree *ntree, const bNodeSocket *socket)
{
int count = 0;
LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {
- if (link->fromsock == sock) {
- count++;
- }
- if (link->tosock == sock) {
+ if (ELEM(socket, link->fromsock, link->tosock)) {
count++;
}
}