Skip to content

Commit 50131de

Browse files
committed
Zend: Use zend_hash_str_find_ptr_lc() in zend_get_module_version()
1 parent f16ef85 commit 50131de

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Zend/zend_API.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4384,14 +4384,8 @@ ZEND_API void zend_get_callable_zval_from_fcc(const zend_fcall_info_cache *fcc,
43844384

43854385
ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
43864386
{
4387-
zend_string *lname;
43884387
size_t name_len = strlen(module_name);
4389-
zend_module_entry *module;
4390-
4391-
lname = zend_string_alloc(name_len, 0);
4392-
zend_str_tolower_copy(ZSTR_VAL(lname), module_name, name_len);
4393-
module = zend_hash_find_ptr(&module_registry, lname);
4394-
zend_string_efree(lname);
4388+
zend_module_entry *module = zend_hash_str_find_ptr_lc(&module_registry, module_name, name_len);
43954389
return module ? module->version : NULL;
43964390
}
43974391
/* }}} */

0 commit comments

Comments
 (0)