Skip to content

Commit f015d01

Browse files
LamentXU123Girgias
andauthored
Apply suggestions from code review
Co-authored-by: Gina Peter Banyard <girgias@php.net>
1 parent b06bea7 commit f015d01

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ext/zlib/zlib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,12 +854,12 @@ static bool zlib_create_dictionary_string(HashTable *options, char **dict, size_
854854
return true;
855855
}
856856

857-
static bool zlib_get_long_option(HashTable *options, const char *option_name, size_t option_name_len, zend_long *value)
857+
ZEND_ATTRIBUTE_NONNULL static bool zlib_get_long_option(HashTable *options, const char *option_name, size_t option_name_len, zend_long *value)
858858
{
859-
zval *option_buffer;
860859
bool failed = false;
860+
zval *option_buffer = zend_hash_str_find(options, option_name, option_name_len);
861861

862-
if (!options || (option_buffer = zend_hash_str_find(options, option_name, option_name_len)) == NULL) {
862+
if (!option_buffer) {
863863
return true;
864864
}
865865

@@ -1103,7 +1103,7 @@ PHP_FUNCTION(deflate_init)
11031103
zend_long encoding, level = -1, memory = 8, window = 15, strategy = Z_DEFAULT_STRATEGY;
11041104
char *dict = NULL;
11051105
size_t dictlen = 0;
1106-
HashTable *options = NULL;
1106+
HashTable *options = (HashTable*)&zend_empty_array;
11071107

11081108
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|H", &encoding, &options)) {
11091109
RETURN_THROWS();

0 commit comments

Comments
 (0)