firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Move the call of the checkArgsMismatch function before the call of th…

Open Zhdanov0 opened this issue 1 year ago • 0 comments

…e setParamsFunc function

Why checkArgsMismatch is executed after the setParamsFunc function and not before it? I think it is more logical to make the checkArgsMismatch check at the place where I put it in the PR. This location is more advantageous because there will be no need to do extra work in the form of calling the setParamsFunc function and other things if you know in advance that the number of arguments is incorrect.

Also, thanks to this location, we don't need to add the “if (argsCount > 1)” check to the setParamsMakeDbKey function, which saves us from unnecessary branching. If you are happy with this solution, I can remove these checks in the existing setParams functions.

I doubt about removing the checkArgsMismatch function call in SysFuncCallNode::pass2. I haven't found what it might affect and don't understand why it was there.

Zhdanov0 avatar Sep 05 '24 11:09 Zhdanov0