Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead stores from ext/spl #12550

Merged
merged 1 commit into from Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/spl/spl_fixedarray.c
Expand Up @@ -740,7 +740,7 @@ PHP_METHOD(SplFixedArray, fromArray)
}
spl_fixedarray_init(&array, tmp);

ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_index, str_index, element) {
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(data), num_index, element) {
ZVAL_COPY_DEREF(&array.elements[num_index], element);
} ZEND_HASH_FOREACH_END();
Comment on lines +743 to 745
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The double foreach seems possibly unnecessary, but this is already an improvement


Expand Down
4 changes: 2 additions & 2 deletions ext/spl/spl_iterators.c
Expand Up @@ -1198,7 +1198,7 @@ PHP_METHOD(RecursiveTreeIterator, current)
}

if (object->flags & RTIT_BYPASS_CURRENT) {
zend_object_iterator *iterator = object->iterators[object->level].iterator;
zend_object_iterator *iterator;
zval *data;

SPL_FETCH_SUB_ITERATOR(iterator, object);
Expand Down Expand Up @@ -1920,7 +1920,7 @@ PHP_METHOD(RegexIterator, accept)
/* {{{ Returns current regular expression */
PHP_METHOD(RegexIterator, getRegex)
{
spl_dual_it_object *intern = Z_SPLDUAL_IT_P(ZEND_THIS);
spl_dual_it_object *intern;

if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
Expand Down