cvs: ZendEngine2 / zend_execute_API.c

"Dmitry Stogov" <[email protected]> Wed, 08 Apr 2009 13:18:15 -0000
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsdmitry1239196695@cvsserver>
dmitry		Wed Apr  8 13:18:15 2009 UTC

  Modified files:              
    /ZendEngine2	zend_execute_API.c 
  Log:
  Calculate hash value once
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.476&r2=1.477&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.476 ZendEngine2/zend_execute_API.c:1.477
--- ZendEngine2/zend_execute_API.c:1.476	Thu Mar 26 20:01:38 2009
+++ ZendEngine2/zend_execute_API.c	Wed Apr  8 13:18:15 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute_API.c,v 1.476 2009/03/26 20:01:38 felipe Exp $ */
+/* $Id: zend_execute_API.c,v 1.477 2009/04/08 13:18:15 dmitry Exp $ */
 
 #include <stdio.h>
 #include <signal.h>
@@ -1063,6 +1063,7 @@
 	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 @@
 		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_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 @@
 
 	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 @@
 		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);
 	}



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php