From: Rasmus Lerdorf Date: Tue, 14 Jul 2015 02:44:51 +0000 (-0700) Subject: One less comparison X-Git-Tag: php-7.1.1RC1~35^2~6^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=611ff0c84677251132ef7dd2b2794d546a94d3e9;p=php One less comparison --- diff --git a/Zend/zend_list.c b/Zend/zend_list.c index c2cd606074..e38246ee87 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -102,12 +102,14 @@ ZEND_API zend_resource* zend_register_resource(void *rsrc_pointer, int rsrc_type ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type1, int resource_type2) { - if (res && resource_type1 == res->type) { - return res->ptr; - } + if (res) { + if (resource_type1 == res->type) { + return res->ptr; + } - if (res && resource_type2 == res->type) { - return res->ptr; + if (resource_type2 == res->type) { + return res->ptr; + } } if (resource_type_name) {