mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-14 17:06:38 +00:00
[clang-apply-replacements] Avoid repeated hash lookups (NFC) (#111783)
This commit is contained in:
parent
058ede06c4
commit
77c842f44c
@ -148,11 +148,8 @@ groupReplacements(const TUReplacements &TUs, const TUDiagnostics &TUDs,
|
||||
|
||||
if (auto Entry = SM.getFileManager().getOptionalFileRef(Path)) {
|
||||
if (SourceTU) {
|
||||
auto &Replaces = DiagReplacements[*Entry];
|
||||
auto It = Replaces.find(R);
|
||||
if (It == Replaces.end())
|
||||
Replaces.emplace(R, SourceTU);
|
||||
else if (It->second != SourceTU)
|
||||
auto [It, Inserted] = DiagReplacements[*Entry].try_emplace(R, SourceTU);
|
||||
if (!Inserted && It->second != SourceTU)
|
||||
// This replacement is a duplicate of one suggested by another TU.
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user