| 525 | */ |
| 526 | |
| 527 | CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW |
| 528 | unsigned long CPLHashSetHashStr(const void *elt) |
| 529 | { |
| 530 | if (elt == nullptr) |
| 531 | return 0; |
| 532 | |
| 533 | const unsigned char *pszStr = static_cast<const unsigned char *>(elt); |
| 534 | unsigned long hash = 0; |
| 535 | |
| 536 | int c = 0; |
| 537 | while ((c = *pszStr++) != '\0') |
| 538 | hash = c + (hash << 6) + (hash << 16) - hash; |
| 539 | |
| 540 | return hash; |
| 541 | } |
| 542 | |
| 543 | /************************************************************************/ |
| 544 | /* CPLHashSetEqualStr() */ |
no outgoing calls
no test coverage detected