Hash function using multipy by 31 */
| 175 | |
| 176 | /* Hash function using multipy by 31 */ |
| 177 | static 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 | |
| 192 | static tpl_fcell_t* tpl_produce_field(tpl_t *tpl, |
| 193 | const char* key, |
no outgoing calls
no test coverage detected
searching dependent graphs…