Use ZEND_STRL where appropriate.

Use the `ZEND_STRL` macro in several places rather than manually sending
a static string and its length as a constant.
This commit is contained in:
michael-grunder
2024-06-01 13:13:07 -07:00
committed by Michael Grunder
parent c139de3aba
commit f8c762e70b
4 changed files with 35 additions and 25 deletions
+2 -1
View File
@@ -277,7 +277,8 @@ RedisArray *ra_load_array(const char *name) {
array_init(&z_tmp);
sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp);
if ((z_data = zend_hash_str_find(Z_ARRVAL(z_tmp), name, name_len)) != NULL) {
consistent = Z_TYPE_P(z_data) == IS_STRING && strncmp(Z_STRVAL_P(z_data), "1", 1) == 0;
consistent = Z_TYPE_P(z_data) == IS_STRING &&
strncmp(Z_STRVAL_P(z_data), ZEND_STRL("1")) == 0;
}
zval_dtor(&z_tmp);
}