helly           Sat May 20 19:47:18 2006 UTC

  Modified files:              
    /php-src/ext/spl    spl_array.c 
  Log:
  - Micro optimization
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.110&r2=1.111&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.110 php-src/ext/spl/spl_array.c:1.111
--- php-src/ext/spl/spl_array.c:1.110   Fri Apr  7 22:53:34 2006
+++ php-src/ext/spl/spl_array.c Sat May 20 19:47:18 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.110 2006/04/07 22:53:34 tony2001 Exp $ */
+/* $Id: spl_array.c,v 1.111 2006/05/20 19:47:18 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -260,7 +260,7 @@
 
 /*  We cannot get the pointer pointer so we don't allow it here for now
        if (check_inherited && intern->fptr_offset_get) {
-               return zend_call_method_with_1_params(&object, 
Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset);
+               return zend_call_method_with_1_params(&object, intern->std.ce, 
&intern->fptr_offset_get, "offsetGet", NULL, offset);
        }*/
 
        if (!offset) {
@@ -305,7 +305,7 @@
                if (intern->fptr_offset_get) {
                        zval *rv;
                        SEPARATE_ARG_IF_REF(offset);
-                       zend_call_method_with_1_params(&object, 
Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset); 
+                       zend_call_method_with_1_params(&object, intern->std.ce, 
&intern->fptr_offset_get, "offsetGet", &rv, offset);    
                        zval_ptr_dtor(&offset);
                        if (rv) {
                                zval_ptr_dtor(&intern->retval);
@@ -335,7 +335,7 @@
                } else {
                        SEPARATE_ARG_IF_REF(offset);
                }
-               zend_call_method_with_2_params(&object, Z_OBJCE_P(object), 
&intern->fptr_offset_set, "offsetSet", NULL, offset, value);
+               zend_call_method_with_2_params(&object, intern->std.ce, 
&intern->fptr_offset_set, "offsetSet", NULL, offset, value);
                zval_ptr_dtor(&offset);
                return;
        }
@@ -390,7 +390,7 @@
 
        if (check_inherited && intern->fptr_offset_del) {
                SEPARATE_ARG_IF_REF(offset);
-               zend_call_method_with_1_params(&object, Z_OBJCE_P(object), 
&intern->fptr_offset_del, "offsetUnset", NULL, offset);
+               zend_call_method_with_1_params(&object, intern->std.ce, 
&intern->fptr_offset_del, "offsetUnset", NULL, offset);
                zval_ptr_dtor(&offset);
                return;
        }
@@ -441,7 +441,7 @@
 
        if (check_inherited && intern->fptr_offset_has) {
                SEPARATE_ARG_IF_REF(offset);
-               zend_call_method_with_1_params(&object, Z_OBJCE_P(object), 
&intern->fptr_offset_has, "offsetExists", &rv, offset);
+               zend_call_method_with_1_params(&object, intern->std.ce, 
&intern->fptr_offset_has, "offsetExists", &rv, offset);
                zval_ptr_dtor(&offset);
                if (rv && zend_is_true(rv)) {
                        zval_ptr_dtor(&rv);
@@ -527,7 +527,7 @@
        }
        
        if (Z_TYPE_P(intern->array) == IS_OBJECT) {
-               php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot 
append properties to objects, use %v::offsetSet() instead", 
Z_OBJCE_P(object)->name);
+               php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot 
append properties to objects, use %v::offsetSet() instead", 
intern->std.ce->name);
                return;
        }
 
@@ -920,7 +920,7 @@
                if ((handler != std_object_handlers.get_properties && handler 
!= spl_array_get_properties)
                || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) {
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-                       
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, 
"Overloaded object of type %s is not compatible with %s", 
Z_OBJCE_P(array)->name, intern->std.ce->name);
+                       
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, 
"Overloaded object of type %s is not compatible with %s", intern->std.ce->name, 
intern->std.ce->name);
                        return;
                }
        }
@@ -1350,11 +1350,11 @@
                return;
        }
 
-       if (Z_TYPE_PP(entry) == IS_OBJECT && 
instanceof_function(Z_OBJCE_PP(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) {
+       if (Z_TYPE_PP(entry) == IS_OBJECT && 
instanceof_function(Z_OBJCE_PP(entry), intern->std.ce TSRMLS_CC)) {
                RETURN_ZVAL(*entry, 0, 0);
        }
 
-       spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, *entry 
TSRMLS_CC);
+       spl_instantiate_arg_ex1(intern->std.ce, &return_value, 0, *entry 
TSRMLS_CC);
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to