mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
- Move inline_zend_hash_func() to header file
This commit is contained in:
parent
5676e5ad05
commit
b98acd61f1
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user