File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -453,15 +453,16 @@ CrossTranslationUnitContext::ASTUnitStorage::getASTUnitForFunction(
453
453
return std::move (IndexLoadError);
454
454
455
455
// 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 ()) {
457
458
++NumNotInOtherTU;
458
459
return llvm::make_error<IndexError>(index_error_code::missing_definition);
459
460
}
460
461
461
462
// Search in the index for the filename where the definition of FunctionName
462
463
// resides.
463
464
if (llvm::Expected<ASTUnit *> FoundForFile =
464
- getASTUnitForFile (NameFileMap[FunctionName] , DisplayCTUProgress)) {
465
+ getASTUnitForFile (It-> second , DisplayCTUProgress)) {
465
466
466
467
// Update the cache.
467
468
NameASTUnitMap[FunctionName] = *FoundForFile;
You can’t perform that action at this time.
0 commit comments