]> granicus.if.org Git - php/commitdiff
Remove unused single.leaf member
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 08:42:26 +0000 (10:42 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 08:42:26 +0000 (10:42 +0200)
Zend/zend_generators.c
Zend/zend_generators.h

index 7746c3de9ce31b7298472dffc425439711ef1622..ff3b66a13d85e63ef8b8166a59c3a68e9f0e8794 100644 (file)
@@ -165,14 +165,14 @@ static void zend_generator_remove_child(zend_generator_node *node, zend_generato
 {
        ZEND_ASSERT(node->children >= 1);
        if (node->children == 1) {
-               node->child.single.child = NULL;
+               node->child.single = NULL;
        } else {
                HashTable *ht = node->child.ht;
                zend_hash_index_del(ht, (zend_ulong) child);
                if (node->children == 2) {
                        zend_generator *other_child;
                        ZEND_HASH_FOREACH_PTR(ht, other_child) {
-                               node->child.single.child = other_child;
+                               node->child.single = other_child;
                                break;
                        } ZEND_HASH_FOREACH_END();
                        zend_hash_destroy(ht);
@@ -469,13 +469,13 @@ static void zend_generator_add_child(zend_generator *generator, zend_generator *
        zend_generator_node *node = &generator->node;
 
        if (node->children == 0) {
-               node->child.single.child = child;
+               node->child.single = child;
        } else {
                if (node->children == 1) {
                        HashTable *ht = emalloc(sizeof(HashTable));
                        zend_hash_init(ht, 0, NULL, NULL, 0);
                        zend_hash_index_add_new_ptr(ht,
-                               (zend_ulong) node->child.single.child, node->child.single.child);
+                               (zend_ulong) node->child.single, node->child.single);
                        node->child.ht = ht;
                }
 
@@ -514,7 +514,7 @@ ZEND_API zend_generator *zend_generator_update_root(zend_generator *generator)
 static zend_generator *get_new_root(zend_generator *generator, zend_generator *root)
 {
        while (!root->execute_data && root->node.children == 1) {
-               root = root->node.child.single.child;
+               root = root->node.child.single;
        }
 
        if (root->execute_data) {
index 35ff09c99d86fe2b26bd8955bd5e276fb7bbeff6..a082e46114bbe421a859381ded4356673c244bd6 100644 (file)
@@ -41,10 +41,7 @@ struct _zend_generator_node {
        uint32_t children;
        union {
                HashTable *ht; /* if multiple children */
-               struct { /* if one child */
-                       zend_generator *leaf; /* TODO: Unused, remove. */
-                       zend_generator *child;
-               } single;
+               zend_generator *single; /* if one child */
        } child;
        /* One generator can cache a direct pointer to the current root.
         * The leaf member points back to the generator using the root cache. */