cvs: ZendEngine2(PHP_5_2) / zend_operators.c

From: Date: Wed, 06 Jun 2007 11:57:36 +0000
Subject: cvs: ZendEngine2(PHP_5_2) / zend_operators.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5836@lists.php.net to get a copy of this message
tony2001 Wed Jun 6 11:57:36 2007 UTC Modified files: (Branch: PHP_5_2) /ZendEngine2 zend_operators.c Log: MFH: minor optimization - make sure the objects are not the same instance before we start comparing their properties http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.208.2.4.2.21&r2=1.208.2.4.2.22&diff_format=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.208.2.4.2.21 ZendEngine2/zend_operators.c:1.208.2.4.2.22 --- ZendEngine2/zend_operators.c:1.208.2.4.2.21 Mon Apr 23 09:56:30 2007 +++ ZendEngine2/zend_operators.c Wed Jun 6 11:57:36 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.208.2.4.2.21 2007/04/23 09:56:30 dmitry Exp $ */ +/* $Id: zend_operators.c,v 1.208.2.4.2.22 2007/06/06 11:57:36 tony2001 Exp $ */ #include <ctype.h> @@ -1402,6 +1402,11 @@ /* If both are objects sharing the same comparision handler then use is */ if (eq_comp) { + if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { + /* object handles are identical, apprently this is the same object */ + ZVAL_LONG(result, 0); + COMPARE_RETURN_AND_FREE(SUCCESS); + } ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); COMPARE_RETURN_AND_FREE(SUCCESS); }

« previous php.zend-engine.cvs (#5836) next »