We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba3d174 commit ec60030Copy full SHA for ec60030
llvm/include/llvm/DWARFLinker/IndexedValuesMap.h
@@ -21,11 +21,9 @@ namespace dwarf_linker {
21
template <typename T> class IndexedValuesMap {
22
public:
23
uint64_t getValueIndex(T Value) {
24
- typename ValueToIndexMapTy::iterator It = ValueToIndexMap.find(Value);
25
- if (It == ValueToIndexMap.end()) {
26
- It = ValueToIndexMap.insert(std::make_pair(Value, Values.size())).first;
+ auto [It, Inserted] = ValueToIndexMap.try_emplace(Value, Values.size());
+ if (Inserted)
27
Values.push_back(Value);
28
- }
29
return It->second;
30
}
31
0 commit comments