File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -453,15 +453,16 @@ CrossTranslationUnitContext::ASTUnitStorage::getASTUnitForFunction(
453453 return std::move (IndexLoadError);
454454
455455 // Check if there is an entry in the index for the function.
456- if (!NameFileMap.count (FunctionName)) {
456+ auto It = NameFileMap.find (FunctionName);
457+ if (It == NameFileMap.end ()) {
457458 ++NumNotInOtherTU;
458459 return llvm::make_error<IndexError>(index_error_code::missing_definition);
459460 }
460461
461462 // Search in the index for the filename where the definition of FunctionName
462463 // resides.
463464 if (llvm::Expected<ASTUnit *> FoundForFile =
464- getASTUnitForFile (NameFileMap[FunctionName] , DisplayCTUProgress)) {
465+ getASTUnitForFile (It-> second , DisplayCTUProgress)) {
465466
466467 // Update the cache.
467468 NameASTUnitMap[FunctionName] = *FoundForFile;
You can’t perform that action at this time.
0 commit comments