summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2009-04-08 13:18:15 +0000
committerDmitry Stogov <dmitry@php.net>2009-04-08 13:18:15 +0000
commit740764199812aaff4404421beccef3c4aaca0832 (patch)
tree070d17b5082456fba991904d4095389d672c901b
parente0f577693f18d6f02cdfd501a4625a05515aae79 (diff)
downloadphp-git-740764199812aaff4404421beccef3c4aaca0832.tar.gz
Calculate hash value once
-rw-r--r--Zend/zend_execute_API.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 2042a19a44..8901dc7d70 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1063,6 +1063,7 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, zstr name, int name_length,
char dummy = 1;
zend_fcall_info fcall_info;
zend_fcall_info_cache fcall_cache;
+ ulong hash;
if (name.v == NULL || !name_length) {
return FAILURE;
@@ -1086,7 +1087,9 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, zstr name, int name_length,
lc_name_len -= 1;
}
- if (zend_u_hash_find(EG(class_table), type, lc_name, lc_name_len + 1, (void **) ce) == SUCCESS) {
+ hash = zend_u_inline_hash_func(type, lc_name, lc_name_len + 1);
+
+ if (zend_u_hash_quick_find(EG(class_table), type, lc_name, lc_name_len + 1, hash, (void **) ce) == SUCCESS) {
if (do_normalize) {
efree(lc_free.v);
}
@@ -1108,7 +1111,7 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, zstr name, int name_length,
zend_u_hash_init(EG(in_autoload), 0, NULL, NULL, 0, UG(unicode));
}
- if (zend_u_hash_add(EG(in_autoload), type, lc_name, lc_name_len + 1, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
+ if (zend_u_hash_quick_add(EG(in_autoload), type, lc_name, lc_name_len + 1, hash, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
if (do_normalize) {
efree(lc_free.v);
}
@@ -1149,7 +1152,7 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, zstr name, int name_length,
zval_ptr_dtor(&class_name_ptr);
- zend_u_hash_del(EG(in_autoload), type, lc_name, lc_name_len + 1);
+ zend_u_hash_quick_del(EG(in_autoload), type, lc_name, lc_name_len + 1, hash);
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
@@ -1162,7 +1165,7 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, zstr name, int name_length,
return FAILURE;
}
- retval = zend_u_hash_find(EG(class_table), type, lc_name, lc_name_len + 1, (void **) ce);
+ retval = zend_u_hash_quick_find(EG(class_table), type, lc_name, lc_name_len + 1, hash, (void **) ce);
if (do_normalize) {
efree(lc_free.v);
}