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

Function tpl_hash

app/wizard/tpllib.cpp:177–190  ·  view source on GitHub ↗

Hash function using multipy by 31 */

Source from the content-addressed store, hash-verified

175
176/* Hash function using multipy by 31 */
177static unsigned int tpl_hash(const char *key, int key_len)
178{
179 const char *p_key_end = key + key_len;
180 unsigned int h = *key++;
181
182 while (key != p_key_end && *key != 0)
183 {
184 unsigned int g;
185 h = (h << 5) + *key++;
186 if ((g = h & 0xf0000000) != 0)
187 h = (h ^ (g >> 24) ^ g);
188 }
189 return h % HASH_TABLE_SIZE;
190}
191
192static tpl_fcell_t* tpl_produce_field(tpl_t *tpl,
193 const char* key,

Callers 2

tpl_produce_fieldFunction · 0.70
tpl_produce_sectionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…