com php-src: Remove unnecessary explicit argc check: ext/reflection/php_reflection.c

From: Date: Mon, 02 Jul 2018 16:29:30 +0000
Subject: com php-src: Remove unnecessary explicit argc check: ext/reflection/php_reflection.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-102367@lists.php.net to get a copy of this message
Commit: 1b66ba17ad96518ce100c0a27f7f5a11a4cd1668 Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 2 Jul 2018 18:29:17 +0200 Parents: 76f1d98a0c72ad0c7c3c3f6f440f9f0803ca3932 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1b66ba17ad96518ce100c0a27f7f5a11a4cd1668 Log: Remove unnecessary explicit argc check Instead specify a default value for the argument, which is more idiomatic. Changed paths: M ext/reflection/php_reflection.c Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 20711bc..144714b 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4185,16 +4185,10 @@ ZEND_METHOD(reflection_class, getMethods) { reflection_object *intern; zend_class_entry *ce; - zend_long filter = 0; - int argc = ZEND_NUM_ARGS(); + zend_long filter = ZEND_ACC_PPP_MASK | ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL | ZEND_ACC_STATIC; - if (argc) { - if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ - filter = ZEND_ACC_PPP_MASK | ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL | ZEND_ACC_STATIC; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) { + return; } GET_REFLECTION_OBJECT_PTR(ce); @@ -4377,16 +4371,10 @@ ZEND_METHOD(reflection_class, getProperties) { reflection_object *intern; zend_class_entry *ce; - zend_long filter = 0; - int argc = ZEND_NUM_ARGS(); + zend_long filter = ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC; - if (argc) { - if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ - filter = ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) { + return; } GET_REFLECTION_OBJECT_PTR(ce);

« previous php.cvs (#102367) next »