Skip to content

Commit 0d013cd

Browse files
committed
Use zend_update_property_str() where appropriate
This prevent needless recomputation of the string length
1 parent 875a43a commit 0d013cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/curl/curl_file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
3838
Z_PARAM_STR_OR_NULL(postname)
3939
ZEND_PARSE_PARAMETERS_END();
4040

41-
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(cf), "name", sizeof("name")-1, ZSTR_VAL(fname));
41+
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(cf), "name", sizeof("name")-1, fname);
4242

4343
if (mime) {
44-
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(cf), "mime", sizeof("mime")-1, ZSTR_VAL(mime));
44+
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(cf), "mime", sizeof("mime")-1, mime);
4545
}
4646

4747
if (postname) {
48-
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(cf), "postname", sizeof("postname")-1, ZSTR_VAL(postname));
48+
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(cf), "postname", sizeof("postname")-1, postname);
4949
}
5050
}
5151

@@ -82,7 +82,7 @@ static void curlfile_set_property(char *name, size_t name_len, INTERNAL_FUNCTION
8282
Z_PARAM_STR(arg)
8383
ZEND_PARSE_PARAMETERS_END();
8484

85-
zend_update_property_string(curl_CURLFile_class, Z_OBJ_P(ZEND_THIS), name, name_len, ZSTR_VAL(arg));
85+
zend_update_property_str(curl_CURLFile_class, Z_OBJ_P(ZEND_THIS), name, name_len, arg);
8686
}
8787

8888
/* {{{ Get file name */

0 commit comments

Comments
 (0)