- Move inline_zend_hash_func() to header file

This commit is contained in:
Andi Gutmans 2001-07-11 16:16:08 +00:00
parent 5676e5ad05
commit b98acd61f1
2 changed files with 12 additions and 13 deletions

View File

@ -128,18 +128,6 @@ static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(uint);
static int zend_hash_do_resize(HashTable *ht);
static inline ulong zend_inline_hash_func(char *arKey, uint nKeyLength)
{
ulong h = 5381;
char *arEnd = arKey + nKeyLength;
while (arKey < arEnd) {
h += (h << 5);
h ^= (ulong) *arKey++;
}
return h;
}
ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength)
{
return zend_inline_hash_func(arKey, nKeyLength);

View File

@ -180,7 +180,18 @@ ZEND_API int zend_hash_num_elements(HashTable *ht);
ZEND_API int zend_hash_rehash(HashTable *ht);
/* ZEND_API ulong hashpjw(char *arKey, uint nKeyLength); */
static inline ulong zend_inline_hash_func(char *arKey, uint nKeyLength)
{
ulong h = 5381;
char *arEnd = arKey + nKeyLength;
while (arKey < arEnd) {
h += (h << 5);
h ^= (ulong) *arKey++;
}
return h;
}
ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength);
#if ZEND_DEBUG