From: Dmitry Stogov Date: Sat, 20 Feb 2021 10:59:29 +0000 (+0300) Subject: Reduce ZPP API overhead X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac7e967b675816de7750b96102bdd1317bb65795;p=php Reduce ZPP API overhead --- diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 1abbb5bb64..cdb63f7b88 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -332,15 +332,14 @@ static int filename_is_in_cache(zend_string *filename) static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS) { - zval zfilename; + if (ZEND_NUM_ARGS() == 1) { + zval *zv = ZEND_CALL_ARG(execute_data , 1); - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_array_ex(1, &zfilename) == FAILURE || - Z_TYPE(zfilename) != IS_STRING || - Z_STRLEN(zfilename) == 0) { - return 0; + if (Z_TYPE_P(zv) == IS_STRING && Z_STRLEN_P(zv) != 0) { + return filename_is_in_cache(Z_STR_P(zv)); + } } - return filename_is_in_cache(Z_STR(zfilename)); + return 0; } static ZEND_NAMED_FUNCTION(accel_file_exists)