[clang-tidy] Avoid repeated hash lookups (NFC) (#127444)
This commit is contained in:
@@ -199,10 +199,10 @@ void IncludeModernizePPCallbacks::InclusionDirective(
|
||||
// 2. Insert `using namespace std;` to the beginning of TU.
|
||||
// 3. Do nothing and let the user deal with the migration himself.
|
||||
SourceLocation DiagLoc = FilenameRange.getBegin();
|
||||
if (CStyledHeaderToCxx.count(FileName) != 0) {
|
||||
IncludesToBeProcessed.emplace_back(
|
||||
IncludeMarker{CStyledHeaderToCxx[FileName], FileName,
|
||||
FilenameRange.getAsRange(), DiagLoc});
|
||||
if (auto It = CStyledHeaderToCxx.find(FileName);
|
||||
It != CStyledHeaderToCxx.end()) {
|
||||
IncludesToBeProcessed.emplace_back(IncludeMarker{
|
||||
It->second, FileName, FilenameRange.getAsRange(), DiagLoc});
|
||||
} else if (DeleteHeaders.count(FileName) != 0) {
|
||||
IncludesToBeProcessed.emplace_back(
|
||||
// NOLINTNEXTLINE(modernize-use-emplace) - false-positive
|
||||
|
||||
Reference in New Issue
Block a user