com php-src: avoid unnecessary scoping: main/php_variables. c

From: Date: Fri, 31 Jul 2015 17:09:37 +0000
Subject: com php-src: avoid unnecessary scoping: main/php_variables. c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88257@lists.php.net to get a copy of this message
Commit: 3a66a23679487f4feda699ada109ab2b675e9474 Author: Anatol Belski <ab@php.net> Fri, 31 Jul 2015 14:02:03 +0200 Parents: 7be9e69eafdb1828d09daecde5cd39112db3f581 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3a66a23679487f4feda699ada109ab2b675e9474 Log: avoid unnecessary scoping Changed paths: M main/php_variables.c Diff: diff --git a/main/php_variables.c b/main/php_variables.c index ebc060b..173d6b0 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -592,6 +592,8 @@ PHPAPI void php_build_argv(char *s, zval *track_vars_array) */ static inline void php_register_server_variables(void) { + zval request_time_float, request_time_long; + zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); array_init(&PG(http_globals)[TRACK_VARS_SERVER]); @@ -610,15 +612,12 @@ static inline void php_register_server_variables(void) if (SG(request_info).auth_digest) { php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, &PG(http_globals)[TRACK_VARS_SERVER]); } - /* store request init time */ - { - zval request_time_float, request_time_long; - ZVAL_DOUBLE(&request_time_float, sapi_get_request_time()); - php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, &PG(http_globals)[TRACK_VARS_SERVER]); - ZVAL_LONG(&request_time_long, zend_dval_to_lval(Z_DVAL(request_time_float))); - php_register_variable_ex("REQUEST_TIME", &request_time_long, &PG(http_globals)[TRACK_VARS_SERVER]); - } + /* store request init time */ + ZVAL_DOUBLE(&request_time_float, sapi_get_request_time()); + php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, &PG(http_globals)[TRACK_VARS_SERVER]); + ZVAL_LONG(&request_time_long, zend_dval_to_lval(Z_DVAL(request_time_float))); + php_register_variable_ex("REQUEST_TIME", &request_time_long, &PG(http_globals)[TRACK_VARS_SERVER]); } /* }}} */

« previous php.cvs (#88257) next »