Skip to content

Commit

Permalink
Remove generator iterator member
Browse files Browse the repository at this point in the history
This is probably a leftover from the PHP 5 implementation, where
the iterator was embedded directly in the generator.
  • Loading branch information
nikic committed Jun 30, 2020
1 parent e2a407c commit 89b2483
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions Zend/zend_generators.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,6 @@ ZEND_METHOD(Generator, getReturn)

static void zend_generator_iterator_dtor(zend_object_iterator *iterator) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
generator->iterator = NULL;
zval_ptr_dtor(&iterator->data);
}
/* }}} */
Expand Down Expand Up @@ -1114,8 +1112,7 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob
return NULL;
}

iterator = generator->iterator = emalloc(sizeof(zend_object_iterator));

iterator = emalloc(sizeof(zend_object_iterator));
zend_iterator_init(iterator);

iterator->funcs = &zend_generator_iterator_functions;
Expand Down
2 changes: 0 additions & 2 deletions Zend/zend_generators.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ struct _zend_generator_node {
struct _zend_generator {
zend_object std;

zend_object_iterator *iterator;

/* The suspended execution context. */
zend_execute_data *execute_data;

Expand Down

0 comments on commit 89b2483

Please sign in to comment.