| 76 | |
| 77 | |
| 78 | static inline unsigned int core_case_hash( str *s1, str *s2, unsigned int size) |
| 79 | { |
| 80 | char *p, *end; |
| 81 | register unsigned v; |
| 82 | register unsigned h; |
| 83 | |
| 84 | h=0; |
| 85 | |
| 86 | end=s1->s+s1->len; |
| 87 | for ( p=s1->s ; p<=(end-4) ; p+=4 ){ |
| 88 | v=(ch_icase(*p)<<24)+(ch_icase(p[1])<<16)+(ch_icase(p[2])<<8) |
| 89 | + ch_icase(p[3]); |
| 90 | ch_h_inc; |
| 91 | } |
| 92 | v=0; |
| 93 | for (; p<end ; p++){ v<<=8; v+=ch_icase(*p);} |
| 94 | ch_h_inc; |
| 95 | |
| 96 | if (s2) { |
| 97 | end=s2->s+s2->len; |
| 98 | for (p=s2->s; p<=(end-4); p+=4){ |
| 99 | v=(ch_icase(*p)<<24)+(ch_icase(p[1])<<16)+(ch_icase(p[2])<<8) |
| 100 | + ch_icase(p[3]); |
| 101 | ch_h_inc; |
| 102 | } |
| 103 | v=0; |
| 104 | for (; p<end ; p++){ v<<=8; v+=ch_icase(*p);} |
| 105 | ch_h_inc; |
| 106 | } |
| 107 | h=((h)+(h>>11))+((h>>13)+(h>>23)); |
| 108 | return size?((h)&(size-1)):h; |
| 109 | } |
| 110 | |
| 111 | |
| 112 | #endif |
no outgoing calls
no test coverage detected