* @brief hash lookup key. */
| 110 | * @brief hash lookup key. |
| 111 | */ |
| 112 | HashKey* HashFind(HashKey* key) { |
| 113 | if (!key || !_buckets) { |
| 114 | return NULL; |
| 115 | } |
| 116 | |
| 117 | uint32_t hash = key->HashValue(); |
| 118 | int idx = hash % _max; |
| 119 | HashKey* item = _buckets[idx]; |
| 120 | |
| 121 | for (; item != NULL; item = item->_next_entry) { |
| 122 | if (item->_hash_value != hash) { |
| 123 | continue; |
| 124 | } |
| 125 | |
| 126 | if (item->HashCmp(key) == 0) { |
| 127 | break; |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | return item; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * @brief hash lookup key. |
no test coverage detected