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>2022-09-03 00:20:01 +0300
committerHans Goudey <h.goudey@me.com>2022-09-03 00:20:01 +0300
commita736ca33ab08bc72d17418d0e55c164aa8e306d8 (patch)
tree2ef1db0e86c778a45c59a030936525c2732542e3
parent0b4b3abc0bedf83a0c03732f5de8088ca9627b3a (diff)
Cleanup: Return early
-rw-r--r--source/blender/editors/space_node/node_relationships.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc
index 05d0a546b08..cf6e83c9450 100644
--- a/source/blender/editors/space_node/node_relationships.cc
+++ b/source/blender/editors/space_node/node_relationships.cc
@@ -1347,39 +1347,39 @@ static int cut_links_exec(bContext *C, wmOperator *op)
}
RNA_END;
- if (i > 1) {
- bool found = false;
+ if (i == 0) {
+ return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
+ }
- ED_preview_kill_jobs(CTX_wm_manager(C), &bmain);
+ bool found = false;
- LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &snode.edittree->links) {
- if (node_link_is_hidden_or_dimmed(region.v2d, *link)) {
- continue;
- }
+ ED_preview_kill_jobs(CTX_wm_manager(C), &bmain);
- if (node_links_intersect(*link, mcoords, i)) {
+ LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &snode.edittree->links) {
+ if (node_link_is_hidden_or_dimmed(region.v2d, *link)) {
+ continue;
+ }
- if (found == false) {
- /* TODO(sergey): Why did we kill jobs twice? */
- ED_preview_kill_jobs(CTX_wm_manager(C), &bmain);
- found = true;
- }
+ if (node_links_intersect(*link, mcoords, i)) {
- bNode *to_node = link->tonode;
- nodeRemLink(snode.edittree, link);
- sort_multi_input_socket_links(snode, *to_node, nullptr, nullptr);
+ if (!found) {
+ /* TODO(sergey): Why did we kill jobs twice? */
+ ED_preview_kill_jobs(CTX_wm_manager(C), &bmain);
+ found = true;
}
- }
- ED_node_tree_propagate_change(C, CTX_data_main(C), snode.edittree);
- if (found) {
- return OPERATOR_FINISHED;
+ bNode *to_node = link->tonode;
+ nodeRemLink(snode.edittree, link);
+ sort_multi_input_socket_links(snode, *to_node, nullptr, nullptr);
}
+ }
- return OPERATOR_CANCELLED;
+ ED_node_tree_propagate_change(C, CTX_data_main(C), snode.edittree);
+ if (found) {
+ return OPERATOR_FINISHED;
}
- return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
+ return OPERATOR_CANCELLED;
}
void NODE_OT_links_cut(wmOperatorType *ot)