| 7376 | static const xpath_node_set dummy_node_set; |
| 7377 | |
| 7378 | PUGI__FN unsigned int hash_string(const char_t* str) |
| 7379 | { |
| 7380 | // Jenkins one-at-a-time hash (http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time) |
| 7381 | unsigned int result = 0; |
| 7382 | |
| 7383 | while (*str) |
| 7384 | { |
| 7385 | result += static_cast<unsigned int>(*str++); |
| 7386 | result += result << 10; |
| 7387 | result ^= result >> 6; |
| 7388 | } |
| 7389 | |
| 7390 | result += result << 3; |
| 7391 | result ^= result >> 11; |
| 7392 | result += result << 15; |
| 7393 | |
| 7394 | return result; |
| 7395 | } |
| 7396 | |
| 7397 | template<typename T> |
| 7398 | PUGI__FN T* new_xpath_variable(const char_t* name) |