mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
ext/standard: Reuse computed strlen() value in getopt()
This commit is contained in:
parent
a718110ae0
commit
f3655100b8
1 changed files with 2 additions and 2 deletions
|
@ -1084,13 +1084,13 @@ PHP_FUNCTION(getopt)
|
|||
}
|
||||
} else {
|
||||
/* other strings */
|
||||
if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, strlen(optname))) != NULL) {
|
||||
if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, optname_len)) != NULL) {
|
||||
if (Z_TYPE_P(args) != IS_ARRAY) {
|
||||
convert_to_array(args);
|
||||
}
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
|
||||
} else {
|
||||
zend_hash_str_add(Z_ARRVAL_P(return_value), optname, strlen(optname), &val);
|
||||
zend_hash_str_add(Z_ARRVAL_P(return_value), optname, optname_len, &val);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue