@@ -39,10 +39,10 @@ const php_hash_ops php_hash_murmur3a_ops = {
39
39
PHP_HASH_API void PHP_MURMUR3AInit (PHP_MURMUR3A_CTX * ctx , HashTable * args )
40
40
{
41
41
if (args ) {
42
- zval * seed ;
42
+ zval * seed = zend_hash_str_find_deref ( args , "seed" , sizeof ( "seed" ) - 1 ) ;
43
43
/* This might be a bit too restrictive, but thinking that a seed might be set
44
44
once and for all, it should be done a clean way. */
45
- if (( NULL != ( seed = zend_hash_str_find ( args , "seed" , sizeof ( "seed" ) - 1 ))) && IS_LONG == Z_TYPE_P (seed )) {
45
+ if (seed && IS_LONG == Z_TYPE_P (seed )) {
46
46
ctx -> h = (uint32_t )Z_LVAL_P (seed );
47
47
} else {
48
48
ctx -> h = 0 ;
@@ -96,10 +96,10 @@ const php_hash_ops php_hash_murmur3c_ops = {
96
96
PHP_HASH_API void PHP_MURMUR3CInit (PHP_MURMUR3C_CTX * ctx , HashTable * args )
97
97
{
98
98
if (args ) {
99
- zval * seed ;
99
+ zval * seed = zend_hash_str_find_deref ( args , "seed" , sizeof ( "seed" ) - 1 ) ;
100
100
/* This might be a bit too restrictive, but thinking that a seed might be set
101
101
once and for all, it should be done a clean way. */
102
- if (( NULL != ( seed = zend_hash_str_find ( args , "seed" , sizeof ( "seed" ) - 1 ))) && IS_LONG == Z_TYPE_P (seed )) {
102
+ if (seed && IS_LONG == Z_TYPE_P (seed )) {
103
103
uint32_t _seed = (uint32_t )Z_LVAL_P (seed );
104
104
ctx -> h [0 ] = _seed ;
105
105
ctx -> h [1 ] = _seed ;
@@ -170,10 +170,10 @@ const php_hash_ops php_hash_murmur3f_ops = {
170
170
PHP_HASH_API void PHP_MURMUR3FInit (PHP_MURMUR3F_CTX * ctx , HashTable * args )
171
171
{
172
172
if (args ) {
173
- zval * seed ;
173
+ zval * seed = zend_hash_str_find_deref ( args , "seed" , sizeof ( "seed" ) - 1 ) ;
174
174
/* This might be a bit too restrictive, but thinking that a seed might be set
175
175
once and for all, it should be done a clean way. */
176
- if (( NULL != ( seed = zend_hash_str_find ( args , "seed" , sizeof ( "seed" ) - 1 ))) && IS_LONG == Z_TYPE_P (seed )) {
176
+ if (seed && IS_LONG == Z_TYPE_P (seed )) {
177
177
uint64_t _seed = (uint64_t )Z_LVAL_P (seed );
178
178
ctx -> h [0 ] = _seed ;
179
179
ctx -> h [1 ] = _seed ;
0 commit comments