MCPcopy Create free account
hub / github.com/F-Stack/f-stack / HashFind

Method HashFind

adapter/micro_thread/hash_list.h:112–132  ·  view source on GitHub ↗

* @brief hash lookup key. */

Source from the content-addressed store, hash-verified

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.

Callers 5

FindSessionMethod · 0.80
FindNetItemMethod · 0.80
FindDestLinkMethod · 0.80
GetMsgBufMethod · 0.80
FreeMsgBufMethod · 0.80

Calls 2

HashValueMethod · 0.45
HashCmpMethod · 0.45

Tested by

no test coverage detected