Created
September 7, 2009 05:45
-
-
Save anonymous/182170 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- APC-3.0.19,orig/apc_cache.c 2008-05-15 15:45:27.000000000 +0900 | |
+++ APC-3.0.19/apc_cache.c 2009-09-03 11:54:13.900595000 +0900 | |
@@ -62,24 +62,7 @@ | |
/* }}} */ | |
/* {{{ string_nhash_8 */ | |
-static unsigned int string_nhash_8(const char *s, size_t len) | |
-{ | |
- register const unsigned int *iv = (const unsigned int *)s; | |
- register unsigned int h = 0; | |
- register const unsigned int *e = (const unsigned int *)(s + len - (len % sizeof(unsigned int))); | |
- | |
- for(;iv<e;iv++) { | |
- h += *iv; | |
- h = (h << 7) | (h >> ((8*sizeof(unsigned int)) - 7)); | |
- } | |
- s = (const char *)iv; | |
- for(len %= sizeof(unsigned int);len;len--) { | |
- h += *(s++); | |
- } | |
- h ^= (h >> 13); | |
- h ^= (h >> 7); | |
- return h; | |
-} | |
+#define string_nhash_8(s,len) (unsigned int)(zend_inline_hash_func(s, len)) | |
/* }}} */ | |
/* {{{ make_slot */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment