Skip to content

Commit d2a96d1

Browse files
[clang-change-namespace] Avoid repeated hash lookups (NFC) (#111784)
1 parent 77c842f commit d2a96d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,8 @@ void ChangeNamespaceTool::run(
606606
Result.Nodes.getNodeAs<DeclRefExpr>("func_ref")) {
607607
// If this reference has been processed as a function call, we do not
608608
// process it again.
609-
if (ProcessedFuncRefs.count(FuncRef))
609+
if (!ProcessedFuncRefs.insert(FuncRef).second)
610610
return;
611-
ProcessedFuncRefs.insert(FuncRef);
612611
const auto *Func = Result.Nodes.getNodeAs<FunctionDecl>("func_decl");
613612
assert(Func);
614613
const auto *Context = Result.Nodes.getNodeAs<Decl>("dc");

0 commit comments

Comments
 (0)