com php-src: Remember redundant check in filter.c: ext/filter/filter.c
| From: | Nikita Popov | Date: | Thu, 11 Oct 2018 09:55:16 +0000 |
| Subject: | com php-src: Remember redundant check in filter.c: ext/filter/filter.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103431@lists.php.net to get a copy of this message | ||
Commit: a8bc3889fd07fb4897d1e2b7f2d2b15388d76e39
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 11 Oct 2018 11:55:16 +0200
Parents: 4d5d77904e9e4dc52236ec5416d1ddfef9b3911c
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a8bc3889fd07fb4897d1e2b7f2d2b15388d76e39
Log:
Remember redundant check in filter.c
We already check existence through zend_hash_str_find, no need
to check it twice.
Changed paths:
M ext/filter/filter.c
Diff:
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 987e3e7...5b69024 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -410,8 +410,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
handle_default:
if (options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT)
&&
((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_P(value) == IS_NULL) ||
- (!(flags & FILTER_NULL_ON_FAILURE) && Z_TYPE_P(value) == IS_FALSE)) &&
- zend_hash_str_exists(HASH_OF(options), "default", sizeof("default") - 1)) {
+ (!(flags & FILTER_NULL_ON_FAILURE) && Z_TYPE_P(value) == IS_FALSE))) {
zval *tmp;
if ((tmp = zend_hash_str_find(HASH_OF(options), "default", sizeof("default")
- 1)) != NULL) {
ZVAL_COPY(value, tmp);