Skip to content

Commit 8c8322f

Browse files
authored
ext/xml: Use zend_hash_find_ptr_lc() to avoid allocation in some cases (php#14840)
1 parent 17ef4b7 commit 8c8322f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ext/xml/xml.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,7 @@ static bool php_xml_check_string_method_arg(
10901090
}
10911091

10921092
zend_class_entry *ce = object->ce;
1093-
zend_string *lc_name = zend_string_tolower(method_name);
1094-
zend_function *method_ptr = zend_hash_find_ptr(&ce->function_table, lc_name);
1095-
zend_string_release_ex(lc_name, 0);
1093+
zend_function *method_ptr = zend_hash_find_ptr_lc(&ce->function_table, method_name);
10961094
if (!method_ptr) {
10971095
if (arg_num) {
10981096
zend_argument_value_error(arg_num, "method %s::%s() does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(method_name));

0 commit comments

Comments
 (0)