mirror of https://gitee.com/bigwinds/arangodb
remove unnecessary parameter validation (#6210)
the validation has already been done before, so it does not need to be repeated for each function call invocation
This commit is contained in:
parent
325e61b4ed
commit
d2c2f21c85
|
@ -1400,8 +1400,10 @@ AstNode* Ast::createNodeFunctionCall(char const* functionName, size_t length,
|
|||
auto numExpectedArguments = func->numArguments();
|
||||
|
||||
if (n < numExpectedArguments.first || n > numExpectedArguments.second) {
|
||||
std::string const fname(functionName, length);
|
||||
|
||||
THROW_ARANGO_EXCEPTION_PARAMS(
|
||||
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH, functionName,
|
||||
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH, fname.c_str(),
|
||||
static_cast<int>(numExpectedArguments.first),
|
||||
static_cast<int>(numExpectedArguments.second));
|
||||
}
|
||||
|
|
|
@ -968,7 +968,6 @@ AqlValue Expression::executeSimpleExpressionFCallJS(
|
|||
mustDestroy = false;
|
||||
|
||||
{
|
||||
|
||||
ISOLATE;
|
||||
TRI_ASSERT(isolate != nullptr);
|
||||
TRI_V8_CURRENT_GLOBALS_AND_SCOPE;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -51,20 +51,12 @@ typedef std::function<AqlValue(arangodb::aql::Query*, transaction::Methods*,
|
|||
struct Functions {
|
||||
|
||||
public:
|
||||
/// @brief validate the number of parameters
|
||||
static void ValidateParameters(VPackFunctionParameters const& parameters,
|
||||
char const* function, int minParams,
|
||||
int maxParams);
|
||||
|
||||
static void ValidateParameters(VPackFunctionParameters const& parameters,
|
||||
char const* function, int minParams);
|
||||
static void init();
|
||||
|
||||
/// @brief extract a function parameter from the arguments
|
||||
static AqlValue ExtractFunctionParameterValue(
|
||||
VPackFunctionParameters const& parameters, size_t position);
|
||||
|
||||
public:
|
||||
static void init();
|
||||
/// @brief helper function. not callable as a "normal" AQL function
|
||||
static void Stringify(transaction::Methods* trx,
|
||||
arangodb::basics::VPackStringBufferAdapter& buffer,
|
||||
|
@ -447,12 +439,6 @@ struct Functions {
|
|||
VPackFunctionParameters const&);
|
||||
static AqlValue Position(arangodb::aql::Query*, transaction::Methods*,
|
||||
VPackFunctionParameters const&);
|
||||
static AqlValue CallApplyBackend(arangodb::aql::Query* query,
|
||||
transaction::Methods* trx,
|
||||
VPackFunctionParameters const& parameters,
|
||||
char const* AFN,
|
||||
AqlValue const& invokeFN,
|
||||
VPackFunctionParameters const& invokeParams);
|
||||
static AqlValue Call(arangodb::aql::Query*, transaction::Methods*,
|
||||
VPackFunctionParameters const&);
|
||||
static AqlValue Apply(arangodb::aql::Query*, transaction::Methods*,
|
||||
|
@ -474,13 +460,6 @@ struct Functions {
|
|||
/// @brief dummy function that will only throw an error when called
|
||||
static AqlValue NotImplemented(arangodb::aql::Query*, transaction::Methods*,
|
||||
VPackFunctionParameters const&);
|
||||
|
||||
private:
|
||||
static AqlValue DateFromParameters(arangodb::aql::Query* query,
|
||||
transaction::Methods* trx,
|
||||
VPackFunctionParameters const& parameters,
|
||||
char const* AFN,
|
||||
bool asTimestamp);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue