Use zend_update_property_str() where appropriate

This prevent needless recomputation of the string length
This commit is contained in:
George Peter Banyard 2021-09-29 13:59:28 +01:00
parent 875a43a42c
commit 0d013cd0d7

View file

@ -38,14 +38,14 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
Z_PARAM_STR_OR_NULL(postname)
ZEND_PARSE_PARAMETERS_END();
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(cf), "name", sizeof("name")-1, ZSTR_VAL(fname));
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(cf), "name", sizeof("name")-1, fname);
if (mime) {
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(cf), "mime", sizeof("mime")-1, ZSTR_VAL(mime));
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(cf), "mime", sizeof("mime")-1, mime);
}
if (postname) {
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(cf), "postname", sizeof("postname")-1, ZSTR_VAL(postname));
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(cf), "postname", sizeof("postname")-1, postname);
}
}
@ -82,7 +82,7 @@ static void curlfile_set_property(char *name, size_t name_len, INTERNAL_FUNCTION
Z_PARAM_STR(arg)
ZEND_PARSE_PARAMETERS_END();
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(ZEND_THIS), name, name_len, ZSTR_VAL(arg));
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(ZEND_THIS), name, name_len, arg);
}
/* {{{ Get file name */