You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently evaluating your solution for a personal project, thanks for all your hard work.
I noticed that the methods ServerObjectType::
addObjectTypeVariable
addObjectTypeArrayVariable
addObjectTypeFolder
addHistoricalObjectTypeVariable
will not return the new node ID, when the "mandatory" parameter is true.
The code pattern is identical in all methods:
if (_server.addVariableNode(...) {
if (mandatory) {
return _server.addReference(....);
}
if (!nodeId.isNull())
nodeId = newNode;
return true;
}
So if mandatory is set it will return without doing the assignment "nodeId = newNode;".
Generally suggest using "return early" pattern only for unsuccessful return, i.e. there is only one successful return point at the end of the function, all other early returns are "false".
The text was updated successfully, but these errors were encountered:
I'm currently evaluating your solution for a personal project, thanks for all your hard work.
I noticed that the methods ServerObjectType::
addObjectTypeVariable
addObjectTypeArrayVariable
addObjectTypeFolder
addHistoricalObjectTypeVariable
will not return the new node ID, when the "mandatory" parameter is true.
The code pattern is identical in all methods:
So if mandatory is set it will return without doing the assignment "nodeId = newNode;".
Generally suggest using "return early" pattern only for unsuccessful return, i.e. there is only one successful return point at the end of the function, all other early returns are "false".
The text was updated successfully, but these errors were encountered: