| 193 | } |
| 194 | |
| 195 | static unsigned hash(const void *buffer, size_t len) |
| 196 | { |
| 197 | unsigned long h = 0; |
| 198 | unsigned long g; |
| 199 | const unsigned char* s = (const unsigned char *) buffer; |
| 200 | |
| 201 | /* |
| 202 | * From the "Dragon" book by Aho, Sethi and Ullman. |
| 203 | */ |
| 204 | |
| 205 | while (len-- > 0) { |
| 206 | h = (h << 4) + *s++; |
| 207 | if ((g = (h & 0xf0000000)) != 0) { |
| 208 | h ^= (g >> 24); |
| 209 | h ^= g; |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | return h; |
| 214 | } |
| 215 | |
| 216 | connect_pool* connect_manager::peek(const char* key, |
| 217 | bool exclusive /* = true */) |
no outgoing calls
no test coverage detected
searching dependent graphs…