[php-src] master: Simplify always-true check in zend_generator_update_current (#13848)
| From: | Niels Dossche via GitHub | Date: | Mon, 01 Apr 2024 11:29:14 +0000 |
| Subject: | [php-src] master: Simplify always-true check in zend_generator_update_current (#13848) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127919@lists.php.net to get a copy of this message | ||
Author: Niels Dossche (nielsdos)
Committer: GitHub (web-flow)
Pusher: nielsdos
Date: 2024-04-01T13:29:09+02:00
Commit: https://github.com/php/php-src/commit/c3f5bbde2a92b5e75f09a254c2083f72d56e2e20
Raw diff: https://github.com/php/php-src/commit/c3f5bbde2a92b5e75f09a254c2083f72d56e2e20.diff
Simplify always-true check in zend_generator_update_current (#13848)
old_root is dereferenced at top, so old_root must not be NULL, and
the check doesn't actually do anything.
Changed paths:
M Zend/zend_generators.c
Diff:
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 036aba09805b..3da03e55a6b2 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -579,7 +579,7 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
EG(current_execute_data) = original_execute_data;
- if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
+ if (!(old_root->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
new_root->node.parent = NULL;
OBJ_RELEASE(&new_root_parent->std);
zend_generator_resume(generator);