Skip to content

Commit a8caba6

Browse files
committed
ext/mysqli: Improve variable name and type
1 parent 94b4f74 commit a8caba6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/mysqli/mysqli.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,38 +306,38 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in
306306
{
307307
mysqli_object *obj = php_mysqli_fetch_object(object);
308308
mysqli_prop_handler *p;
309-
int ret = 0;
309+
bool has_property = false;
310310

311311
if ((p = zend_hash_find_ptr(obj->prop_handler, name)) != NULL) {
312312
switch (has_set_exists) {
313313
case ZEND_PROPERTY_EXISTS:
314-
ret = 1;
314+
has_property = true;
315315
break;
316316
case ZEND_PROPERTY_NOT_EMPTY: {
317317
zval rv;
318318
zval *value = mysqli_read_property(object, name, BP_VAR_IS, cache_slot, &rv);
319319
if (value != &EG(uninitialized_zval)) {
320320
convert_to_boolean(value);
321-
ret = Z_TYPE_P(value) == IS_TRUE ? 1 : 0;
321+
has_property = Z_TYPE_P(value) == IS_TRUE;
322322
}
323323
break;
324324
}
325325
case ZEND_PROPERTY_ISSET: {
326326
zval rv;
327327
zval *value = mysqli_read_property(object, name, BP_VAR_IS, cache_slot, &rv);
328328
if (value != &EG(uninitialized_zval)) {
329-
ret = Z_TYPE_P(value) != IS_NULL? 1 : 0;
329+
has_property = Z_TYPE_P(value) != IS_NULL;
330330
zval_ptr_dtor(value);
331331
}
332332
break;
333333
}
334334
EMPTY_SWITCH_DEFAULT_CASE();
335335
}
336336
} else {
337-
ret = zend_std_has_property(object, name, has_set_exists, cache_slot);
337+
has_property = zend_std_has_property(object, name, has_set_exists, cache_slot);
338338
}
339339

340-
return ret;
340+
return has_property;
341341
} /* }}} */
342342

343343
HashTable *mysqli_object_get_debug_info(zend_object *object, int *is_temp)

0 commit comments

Comments
 (0)