mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
Remove unnecessary check
We should only produce IS_UNDEF if an exception is thrown, this check is not needed.
This commit is contained in:
parent
8e0789a21c
commit
3642592a12
@ -153,19 +153,7 @@ ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *ke
|
||||
{
|
||||
zend_user_iterator *iter = (zend_user_iterator*)_iter;
|
||||
zval *object = &iter->it.data;
|
||||
zval retval;
|
||||
|
||||
zend_call_method_with_0_params(Z_OBJ_P(object), iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", &retval);
|
||||
|
||||
if (Z_TYPE(retval) != IS_UNDEF) {
|
||||
ZVAL_COPY_VALUE(key, &retval);
|
||||
} else {
|
||||
if (!EG(exception)) {
|
||||
zend_error(E_WARNING, "Nothing returned from %s::key()", ZSTR_VAL(iter->ce->name));
|
||||
}
|
||||
|
||||
ZVAL_LONG(key, 0);
|
||||
}
|
||||
zend_call_method_with_0_params(Z_OBJ_P(object), iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", key);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user