diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-23 02:18:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-23 02:18:37 +0300 |
commit | 6b662ebdb9a6e6dd08a1df46e2f2eb2c525b30bd (patch) | |
tree | 1a5f9b1aee4433b0b7f10014e6a41fbbdbcca7e7 /source | |
parent | 9033d270d5da1af874796d70a0f71c28a9f4c5da (diff) |
Cleanup: Return early
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index e4f2e8ef7f4..4d6fb328ad9 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -136,16 +136,18 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.inputs().take_front(2)); const std::optional<CustomDataType> type = node_type_from_other_socket(params.other_socket()); + if (!type) { + return; + } + if (params.in_out() == SOCK_IN) { - if (type) { - params.add_item(IFACE_("Attribute"), [node_type, type](LinkSearchOpParams ¶ms) { - bNode &node = params.add_node(node_type); - node.custom1 = *type; - params.update_and_connect_available_socket(node, "Attribute"); - }); - } + params.add_item(IFACE_("Attribute"), [node_type, type](LinkSearchOpParams ¶ms) { + bNode &node = params.add_node(node_type); + node.custom1 = *type; + params.update_and_connect_available_socket(node, "Attribute"); + }); } - else if (type) { + else { for (const SocketDeclarationPtr &socket_decl : declaration.outputs()) { StringRefNull name = socket_decl->name(); params.add_item(IFACE_(name.c_str()), [node_type, name, type](LinkSearchOpParams ¶ms) { |