Skip to content

Commit 3642592

Browse files
committed
Remove unnecessary check
We should only produce IS_UNDEF if an exception is thrown, this check is not needed.
1 parent 8e0789a commit 3642592

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

Zend/zend_interfaces.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,7 @@ ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *ke
153153
{
154154
zend_user_iterator *iter = (zend_user_iterator*)_iter;
155155
zval *object = &iter->it.data;
156-
zval retval;
157-
158-
zend_call_method_with_0_params(Z_OBJ_P(object), iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", &retval);
159-
160-
if (Z_TYPE(retval) != IS_UNDEF) {
161-
ZVAL_COPY_VALUE(key, &retval);
162-
} else {
163-
if (!EG(exception)) {
164-
zend_error(E_WARNING, "Nothing returned from %s::key()", ZSTR_VAL(iter->ce->name));
165-
}
166-
167-
ZVAL_LONG(key, 0);
168-
}
156+
zend_call_method_with_0_params(Z_OBJ_P(object), iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", key);
169157
}
170158
/* }}} */
171159

0 commit comments

Comments
 (0)