From 3dd2df85b33ea1b5e13bcdb8e73c982cfacd5be4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 16 Apr 2016 15:15:44 +0200 Subject: [PATCH] Drop unnecessary checks in get_closure --- Zend/zend_closures.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index a00d000e6e..989ef769c8 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -382,23 +382,16 @@ static zend_object *zend_closure_clone(zval *zobject) /* {{{ */ int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */ { - zend_closure *closure; - - if (Z_TYPE_P(obj) != IS_OBJECT) { - return FAILURE; - } - - closure = (zend_closure *)Z_OBJ_P(obj); + zend_closure *closure = (zend_closure *)Z_OBJ_P(obj); *fptr_ptr = &closure->func; *ce_ptr = closure->called_scope; - if (obj_ptr) { - if (Z_TYPE(closure->this_ptr) != IS_UNDEF) { - *obj_ptr = Z_OBJ(closure->this_ptr); - } else { - *obj_ptr = NULL; - } + if (Z_TYPE(closure->this_ptr) != IS_UNDEF) { + *obj_ptr = Z_OBJ(closure->this_ptr); + } else { + *obj_ptr = NULL; } + return SUCCESS; } /* }}} */ -- 2.40.0