internal override ExpressionNode Optimize()
{
for (int i = 0; i < _argumentCount; i++)
{
_arguments[i] = _arguments[i].Optimize();
}
Debug.Assert(_info > -1, "Optimizing unbound function "); // default info is -1, it means if not bounded, it should be -1, not 0!!
if (s_funcs[_info]._id == FunctionId.In)
{
// we can not optimize the in node, just check that it has all constant arguments
if (!IsConstant())
{
throw ExprException.NonConstantArgument();
}
}
else
{
if (IsConstant())
{
return(new ConstNode(table, ValueType.Object, Eval(), false));
}
}
return(this);
}