com php-src: Simplify the condition: Zend/zend_compile.c

From: Date: Sun, 14 Jun 2015 14:56:06 +0000
Subject: com php-src: Simplify the condition: Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87259@lists.php.net to get a copy of this message
Commit: f1ae57f155438d8aacbae7cebb5e244b7f9cfc58 Author: Xinchen Hui <laruence@php.net> Sun, 14 Jun 2015 22:56:06 +0800 Parents: 7221bd682fea2b9f33646024edb8e3e648b0916a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f1ae57f155438d8aacbae7cebb5e244b7f9cfc58 Log: Simplify the condition Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2cb76a7..6164242 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5841,10 +5841,8 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */ zend_compile_expr(&left_node, left_ast); if (left_node.op_type == IS_CONST) { - if ( - (ast->kind == ZEND_AST_AND && !zend_is_true(&left_node.u.constant)) - || (ast->kind == ZEND_AST_OR && zend_is_true(&left_node.u.constant)) - ) { + if ((ast->kind == ZEND_AST_AND && !zend_is_true(&left_node.u.constant)) + || (ast->kind == ZEND_AST_OR && zend_is_true(&left_node.u.constant))) { result->op_type = IS_CONST; ZVAL_BOOL(&result->u.constant, zend_is_true(&left_node.u.constant)); } else { @@ -5870,8 +5868,7 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */ if (left_node.op_type == IS_TMP_VAR) { SET_NODE(opline_jmpz->result, &left_node); - } - if (left_node.op_type != IS_TMP_VAR) { + } else { opline_jmpz->result.var = get_temporary_variable(CG(active_op_array)); opline_jmpz->result_type = IS_TMP_VAR; } @@ -5879,10 +5876,8 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */ zend_compile_expr(&right_node, right_ast); if (right_node.op_type == IS_CONST && opnum_jmpz == CG(active_op_array)->last) { - if ( - (ast->kind == ZEND_AST_AND && !zend_is_true(&right_node.u.constant)) - || (ast->kind == ZEND_AST_OR && zend_is_true(&right_node.u.constant)) - ) { + if ((ast->kind == ZEND_AST_AND && !zend_is_true(&right_node.u.constant)) + || (ast->kind == ZEND_AST_OR && zend_is_true(&right_node.u.constant))) { CG(active_op_array)->last--; result->op_type = IS_CONST; ZVAL_BOOL(&result->u.constant, zend_is_true(&right_node.u.constant));

« previous php.cvs (#87259) next »