[clang-change-namespace] Avoid repeated hash lookups (NFC) (#111784)

This commit is contained in:
Kazu Hirata 2024-10-10 08:16:51 -07:00 committed by GitHub
parent 77c842f44c
commit d2a96d170a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -606,9 +606,8 @@ void ChangeNamespaceTool::run(
Result.Nodes.getNodeAs<DeclRefExpr>("func_ref")) {
// If this reference has been processed as a function call, we do not
// process it again.
if (ProcessedFuncRefs.count(FuncRef))
if (!ProcessedFuncRefs.insert(FuncRef).second)
return;
ProcessedFuncRefs.insert(FuncRef);
const auto *Func = Result.Nodes.getNodeAs<FunctionDecl>("func_decl");
assert(Func);
const auto *Context = Result.Nodes.getNodeAs<Decl>("dc");