helly           Mon Nov  1 18:02:11 2004 EDT

  Modified files:              
    /php-src/ext/spl    spl_iterators.c 
  Log:
  - Cache function lookup
  
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.52&r2=1.53&ty=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.52 php-src/ext/spl/spl_iterators.c:1.53
--- php-src/ext/spl/spl_iterators.c:1.52        Mon Nov  1 17:54:10 2004
+++ php-src/ext/spl/spl_iterators.c     Mon Nov  1 18:02:10 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_iterators.c,v 1.52 2004/11/01 22:54:10 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.53 2004/11/01 23:02:10 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -85,6 +85,9 @@
        spl_sub_iterator         *iterators;
        int                      level;
        RecursiveIteratorMode    mode;
+       zend_function            *beginChildren;
+       zend_function            *endChildren;
+       zend_class_entry         *ce;
 } spl_recursive_it_object;
 
 typedef struct _spl_recursive_it_iterator {
@@ -228,7 +231,7 @@
                                if (sub_iter->funcs->rewind) {
                                        sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
                                }
-                               zend_call_method_with_0_params(&zthis, NULL, NULL, 
"beginchildren", NULL);
+                               zend_call_method_with_0_params(&zthis, object->ce, 
&object->beginChildren, "beginchildren", NULL);
                                goto next_step;
                }
                /* no more elements */
@@ -236,7 +239,7 @@
                        iterator->funcs->dtor(iterator TSRMLS_CC);
                        zval_ptr_dtor(&object->iterators[object->level].zobject);
                        object->level--;
-                       zend_call_method_with_0_params(&zthis, NULL, NULL, 
"endchildren", NULL);
+                       zend_call_method_with_0_params(&zthis, object->ce, 
&object->endChildren, "endchildren", NULL);
                } else {
                        return; /* done completeley */
                }
@@ -251,7 +254,7 @@
                sub_iter = object->iterators[object->level].iterator;
                sub_iter->funcs->dtor(sub_iter TSRMLS_CC);
                zval_ptr_dtor(&object->iterators[object->level--].zobject);
-               zend_call_method_with_0_params(&zthis, NULL, NULL, "endchildren", 
NULL);
+               zend_call_method_with_0_params(&zthis, object->ce, 
&object->endChildren, "endchildren", NULL);
        }
        erealloc(object->iterators, sizeof(spl_sub_iterator));
        object->iterators[0].state = RS_START;
@@ -314,6 +317,9 @@
        intern->iterators = emalloc(sizeof(spl_sub_iterator));
        intern->level = 0;
        intern->mode = mode;
+       intern->beginChildren = NULL;
+       intern->endChildren = NULL;
+       intern->ce = Z_OBJCE_P(object);
        ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use 
spl_ce_RecursiveIterator */
        intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, 
iterator TSRMLS_CC);
        iterator->refcount++;

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

Reply via email to