com php-src: Removed deprecated paths. Changed "switch" into series of "if".: Zend/zend_variables.c
| From: | Dmitry Stogov | Date: | Tue, 03 Mar 2015 13:49:45 +0000 |
| Subject: | com php-src: Removed deprecated paths. Changed "switch" into series of "if".: Zend/zend_variables.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85170@lists.php.net to get a copy of this message | ||
Commit: 6b9c40280a5e4bedf4ea2d583a3acc4e7d0730f6
Author: Dmitry Stogov <dmitry@zend.com> Tue, 3 Mar 2015 16:49:45 +0300
Parents: bc28ed6788459829593c5ddff310a505651cb797
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6b9c40280a5e4bedf4ea2d583a3acc4e7d0730f6
Log:
Removed deprecated paths. Changed "switch" into series of "if".
Changed paths:
M Zend/zend_variables.c
Diff:
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 2f0c403..6baebaa 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -225,29 +225,19 @@ ZEND_API void zval_add_ref_unref(zval *p)
ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
- switch (Z_TYPE_P(zvalue)) {
- case IS_CONSTANT:
- case IS_STRING:
- CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
- Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
- break;
- case IS_ARRAY:
- ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
- break;
- case IS_CONSTANT_AST: {
- zend_ast_ref *ast = emalloc(sizeof(zend_ast_ref));
-
- GC_REFCOUNT(ast) = 1;
- GC_TYPE_INFO(ast) = IS_CONSTANT_AST;
- ast->ast = zend_ast_copy(Z_ASTVAL_P(zvalue));
- Z_AST_P(zvalue) = ast;
- }
- break;
- case IS_OBJECT:
- case IS_RESOURCE:
- case IS_REFERENCE:
- Z_ADDREF_P(zvalue);
- break;
+ if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
+ ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
+ } else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
+ EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
+ CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
+ Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
+ } else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
+ zend_ast_ref *ast = emalloc(sizeof(zend_ast_ref));
+
+ GC_REFCOUNT(ast) = 1;
+ GC_TYPE_INFO(ast) = IS_CONSTANT_AST;
+ ast->ast = zend_ast_copy(Z_ASTVAL_P(zvalue));
+ Z_AST_P(zvalue) = ast;
}
}