summaryrefslogtreecommitdiff
path: root/ext/filter
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-10-11 11:55:16 +0200
committerNikita Popov <nikita.ppv@gmail.com>2018-10-11 11:55:16 +0200
commita8bc3889fd07fb4897d1e2b7f2d2b15388d76e39 (patch)
tree88b3224ecf7ddadf278e869e713381bf078be4e9 /ext/filter
parent4d5d77904e9e4dc52236ec5416d1ddfef9b3911c (diff)
downloadphp-git-a8bc3889fd07fb4897d1e2b7f2d2b15388d76e39.tar.gz
Remember redundant check in filter.c
We already check existence through zend_hash_str_find, no need to check it twice.
Diffstat (limited to 'ext/filter')
-rw-r--r--ext/filter/filter.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 987e3e7ef5..5b69024526 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);