Skip to content

Commit ac7e967

Browse files
committed
Reduce ZPP API overhead
1 parent f37fe68 commit ac7e967

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

ext/opcache/zend_accelerator_module.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,14 @@ static int filename_is_in_cache(zend_string *filename)
332332

333333
static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS)
334334
{
335-
zval zfilename;
335+
if (ZEND_NUM_ARGS() == 1) {
336+
zval *zv = ZEND_CALL_ARG(execute_data , 1);
336337

337-
if (ZEND_NUM_ARGS() != 1 ||
338-
zend_get_parameters_array_ex(1, &zfilename) == FAILURE ||
339-
Z_TYPE(zfilename) != IS_STRING ||
340-
Z_STRLEN(zfilename) == 0) {
341-
return 0;
338+
if (Z_TYPE_P(zv) == IS_STRING && Z_STRLEN_P(zv) != 0) {
339+
return filename_is_in_cache(Z_STR_P(zv));
340+
}
342341
}
343-
return filename_is_in_cache(Z_STR(zfilename));
342+
return 0;
344343
}
345344

346345
static ZEND_NAMED_FUNCTION(accel_file_exists)

0 commit comments

Comments
 (0)