| 30 | } |
| 31 | |
| 32 | int BlCvRecordMap::TryInsert(const char* name, const Val128& key) |
| 33 | { |
| 34 | auto pair = mKeySet.insert(key); |
| 35 | if (!pair.second) |
| 36 | return -1; |
| 37 | |
| 38 | //BL_AUTOPERF_CV("BlCvRecordMap::TryInsert insert"); |
| 39 | |
| 40 | int hashKey = BlHash::HashStr_PdbV1(name) % 4096; |
| 41 | /*auto checkEntry = mBuckets[hashKey]; |
| 42 | while (checkEntry != NULL) |
| 43 | { |
| 44 | if (checkEntry->mKey == key) |
| 45 | return -1; |
| 46 | checkEntry = checkEntry->mNext; |
| 47 | }*/ |
| 48 | |
| 49 | auto entry = mAlloc.Alloc<BlCvRecordEntry>(); |
| 50 | entry->mKey = key; |
| 51 | entry->mNext = mBuckets[hashKey]; |
| 52 | mBuckets[hashKey] = entry; |
| 53 | mNumEntries++; |
| 54 | entry->mRecordIndex = mCodeView->mSymRecordsWriter.GetStreamPos(); |
| 55 | return entry->mRecordIndex; |
| 56 | } |
| 57 | |
| 58 | |
| 59 | ////////////////////////////////////////////////////////////////////////// |
no test coverage detected