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 1d44ecb commit 13546c2Copy full SHA for 13546c2
clang/lib/CodeGen/CodeGenFunction.h
@@ -1143,17 +1143,11 @@ class CodeGenFunction : public CodeGenTypeCache {
1143
/// Copy all the entries in the source map over the corresponding
1144
/// entries in the destination, which must exist.
1145
static void copyInto(const DeclMapTy &Src, DeclMapTy &Dest) {
1146
- for (auto &Pair : Src) {
1147
- if (!Pair.second.isValid()) {
1148
- Dest.erase(Pair.first);
1149
- continue;
1150
- }
1151
-
1152
- auto I = Dest.find(Pair.first);
1153
- if (I != Dest.end())
1154
- I->second = Pair.second;
+ for (auto &[Decl, Addr] : Src) {
+ if (!Addr.isValid())
+ Dest.erase(Decl);
1155
else
1156
- Dest.insert(Pair);
+ Dest.insert_or_assign(Decl, Addr);
1157
}
1158
1159
};
0 commit comments