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