[php-src] PR #11040: Move EG(exception) check outside the loop for unpacking
| From: | nielsdos | Date: | Sat, 08 Apr 2023 15:06:43 +0000 |
| Subject: | [php-src] PR #11040: Move EG(exception) check outside the loop for unpacking | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22273@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11040
Author: nielsdos
Right now there's an EG(exception) check inside the loop for the iterator object. As far as I
know, funcs->valid(iter) will return FAILURE when an exception is set instead of success. That
means that the exception check was not put there for funcs->valid. But it could be for
funcs->rewind(iter), because if I look at other callers it looks like other callers do check for
an exception after calling that function.
Move it outside the loop and inside the funcs->rewind case for better performance.
I think this is also more correct because funcs->valid(iter) probably shouldn't be called if
the rewinding failed.