summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-30 01:13:39 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-30 01:13:39 +0300
commit084c17fe0b68d391467fd48a14433443d4fcba81 (patch)
tree1f2dbd5590c331de3dcec244aa6e92cc35d55a03 /ext/reflection/php_reflection.c
parentfa5c186cc00fb31c4953cb0006f9e8bc066ac77a (diff)
downloadphp-git-084c17fe0b68d391467fd48a14433443d4fcba81.tar.gz
Use zend_string_tolower() where it's possible (to avoid reallocations).
Allow zend_string_tolower_ex() to create parsistent strings
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index d6b6d9718e..d5194d08ac 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -731,7 +731,6 @@ static void _function_string(smart_str *str, zend_function *fptr, zend_class_ent
smart_str param_indent = {0};
zend_function *overwrites;
zend_string *lc_name;
- size_t lc_name_len;
/* TBD: Repair indenting of doc comment (or is this to be done in the parser?)
* What's "wrong" is that any whitespace before the doc comment start is
@@ -755,15 +754,13 @@ static void _function_string(smart_str *str, zend_function *fptr, zend_class_ent
if (fptr->common.scope != scope) {
smart_str_append_printf(str, ", inherits %s", ZSTR_VAL(fptr->common.scope->name));
} else if (fptr->common.scope->parent) {
- lc_name_len = ZSTR_LEN(fptr->common.function_name);
- lc_name = zend_string_alloc(lc_name_len, 0);
- zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(fptr->common.function_name), lc_name_len);
+ lc_name = zend_string_tolower(fptr->common.function_name);
if ((overwrites = zend_hash_find_ptr(&fptr->common.scope->parent->function_table, lc_name)) != NULL) {
if (fptr->common.scope != overwrites->common.scope) {
smart_str_append_printf(str, ", overwrites %s", ZSTR_VAL(overwrites->common.scope->name));
}
}
- efree(lc_name);
+ zend_string_release(lc_name);
}
}
if (fptr->common.prototype && fptr->common.prototype->common.scope) {