etienneb added a comment.

+ Removed copy of a vector to a set
+ Fixed some minor coding-style issues


================
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:140
@@ +139,3 @@
+  const LangOptions &LO = Finder->getASTContext().getLangOpts();
+  std::set<std::string> Names(NameRefs.begin(), NameRefs.end());
+  SourceLocation Loc = Node.getExprLoc();
----------------
alexfh wrote:
> Is there a way to not create a set on each call to the matcher? There also 
> might be a more suitable container in llvm/ADT.
Some ideas:
1) We may assume the vector is small and do the lookup.
2) We may assume a sorted vector and do a binary search.
3) The matcher could receive a set instead of a vector and lifting out the copy.

Implemented 3)


http://reviews.llvm.org/D19703



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to