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 668cbd8 commit bdb6f1bCopy full SHA for bdb6f1b
clang/lib/APINotes/APINotesWriter.cpp
@@ -147,14 +147,8 @@ class APINotesWriter::Implementation {
147
for (auto piece : SelectorRef.Identifiers)
148
Selector.Identifiers.push_back(getIdentifier(piece));
149
150
- // Look for the stored selector.
151
- auto Known = SelectorIDs.find(Selector);
152
- if (Known != SelectorIDs.end())
153
- return Known->second;
154
-
155
- // Add to the selector table.
156
- Known = SelectorIDs.insert({Selector, SelectorIDs.size()}).first;
157
+ // Look for the stored selector. Add to the selector table if missing.
+ return SelectorIDs.try_emplace(Selector, SelectorIDs.size()).first->second;
158
}
159
160
private:
0 commit comments