Nodes: remove redundant increment node tree current socket index

`ntree->cur_index` was being incremented twice in make_socket_interface.

Reviewed By: JacquesLucke

Ref D11590
This commit is contained in:
Campbell Barton 2021-06-14 18:37:25 +10:00 committed by Campbell Barton
parent 03544ed54f
commit 2db09f67a4
1 changed files with 1 additions and 3 deletions

View File

@ -3342,8 +3342,6 @@ static bNodeSocket *make_socket_interface(bNodeTree *ntree,
const char *name)
{
bNodeSocketType *stype = nodeSocketTypeFind(idname);
int own_index = ntree->cur_index++;
if (stype == nullptr) {
return nullptr;
}
@ -3355,7 +3353,7 @@ static bNodeSocket *make_socket_interface(bNodeTree *ntree,
sock->type = SOCK_CUSTOM; /* int type undefined by default */
/* assign new unique index */
own_index = ntree->cur_index++;
const int own_index = ntree->cur_index++;
/* use the own_index as socket identifier */
if (in_out == SOCK_IN) {
BLI_snprintf(sock->identifier, MAX_NAME, "Input_%d", own_index);