Skip to content

Commit 466753b

Browse files
[AST] Avoid repeated map lookups (NFC) (#122858)
1 parent a1f8ce6 commit 466753b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ExternalASTMerger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ bool ExternalASTMerger::HasImporterForOrigin(ASTContext &OriginContext) {
276276
template <typename CallbackType>
277277
void ExternalASTMerger::ForEachMatchingDC(const DeclContext *DC,
278278
CallbackType Callback) {
279-
if (Origins.count(DC)) {
280-
ExternalASTMerger::DCOrigin Origin = Origins[DC];
279+
if (auto It = Origins.find(DC); It != Origins.end()) {
280+
ExternalASTMerger::DCOrigin Origin = It->second;
281281
LazyASTImporter &Importer = LazyImporterForOrigin(*this, *Origin.AST);
282282
Callback(Importer, Importer.GetReverse(), Origin.DC);
283283
} else {

0 commit comments

Comments
 (0)