Cleanup: Reduce nesteds in node.cc #105509

Merged
Hans Goudey merged 12 commits from mod_moder/blender:cleanup_reduce_nesteds into main 2023-04-16 22:53:20 +02:00
1 changed files with 1 additions and 4 deletions
Showing only changes of commit 814b9c36d7 - Show all commits

View File

@ -3758,10 +3758,7 @@ int nodeSocketLinkLimit(const bNodeSocket *sock)
if (!stype.use_link_limits_of_type) {
return sock->limit;
}
if (sock->in_out == SOCK_IN) {
return stype.input_link_limit;
}
return stype.output_link_limit;
return sock->in_out == SOCK_IN ? stype.input_link_limit : stype.output_link_limit;
mod_moder marked this conversation as resolved Outdated

Personally I find this easier to read than what you've done here. It's a simple check and splitting it over multiple lines makes it seem more complex than it is.
return sock->in_out == SOCK_IN ? stype.input_link_limit : stype.output_link_limit;

Personally I find this easier to read than what you've done here. It's a simple check and splitting it over multiple lines makes it seem more complex than it is. ` return sock->in_out == SOCK_IN ? stype.input_link_limit : stype.output_link_limit;`
}
static void update_socket_declarations(ListBase *sockets,