Browse Source

Remember redundant check in filter.c

We already check existence through zend_hash_str_find, no need
to check it twice.
pull/3597/head
Nikita Popov 8 years ago
parent
commit
a8bc3889fd
  1. 3
      ext/filter/filter.c

3
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);

Loading…
Cancel
Save