| 258 | } |
| 259 | |
| 260 | const char * GlobalStringTable::Find(char const * s, uint64_t length) const |
| 261 | { |
| 262 | auto const & entry = HashTable[Hash(s, length)]; |
| 263 | auto numItems = entry.Count(); |
| 264 | for (uint32_t i = 0; i < numItems; i++) { |
| 265 | const char * str = entry.Get(i); |
| 266 | // FIXME: length not available in buffer? |
| 267 | //unsigned strLength = *(uint16_t const *)(s - 4); |
| 268 | if (/*strLength == length && strncmp(s, str, length) == 0*/ |
| 269 | str != nullptr && strcmp(s, str) == 0) |
| 270 | { |
| 271 | return str; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | return nullptr; |
| 276 | } |
| 277 | |
| 278 | uint32_t GlobalStringTable::Hash(char const * s, uint64_t length) |
| 279 | { |
no test coverage detected