MCPcopy Create free account
hub / github.com/acl-dev/acl / hash

Function hash

lib_acl_cpp/independent/connpool/src/connect_manager.cpp:195–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195static 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
216connect_pool* connect_manager::peek(const char* key,
217 bool exclusive /* = true */)

Callers 1

peekMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…