Return the index of the entry with a given key or INVALID_INDEX if there is no entry with this key
| 85 | |
| 86 | /// Return the index of the entry with a given key or INVALID_INDEX if there is no entry with this key |
| 87 | uint64 findEntry(const K& key) const { |
| 88 | |
| 89 | if (mHashSize > 0) { |
| 90 | |
| 91 | const size_t hashCode = Hash()(key); |
| 92 | const size_t divider = mHashSize - 1; |
| 93 | const uint64 bucket = static_cast<uint64>(hashCode & divider); |
| 94 | auto keyEqual = KeyEqual(); |
| 95 | |
| 96 | for (uint64 i = mBuckets[bucket]; i != INVALID_INDEX; i = mNextEntries[i]) { |
| 97 | if (Hash()(mEntries[i].first) == hashCode && keyEqual(mEntries[i].first, key)) { |
| 98 | return i; |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | return INVALID_INDEX; |
| 104 | } |
| 105 | |
| 106 | public: |
| 107 |
nothing calls this directly
no outgoing calls
no test coverage detected