jdenny marked an inline comment as done.
jdenny added inline comments.

================
Comment at: lib/Frontend/VerifyDiagnosticConsumer.cpp:398
+    // DToken is foo-bar-warning, but foo is the only -verify prefix).
+    if (Prefixes.end() == std::find(Prefixes.begin(), Prefixes.end(), DToken))
+      continue;
----------------
hfinkel wrote:
> > Converts from std::vector to std::set for more efficient prefix lookup.
> 
> Don't do that. First, std::find is O(N) here anyway. You'd want to use 
> Prefixes.find(...) instead. However, this set is essentially constant and 
> you're trying to optimize the lookup. In such a case, std::set is not a good 
> choice. Just use a sorted vector instead (e.g., call std::sort on the 
> vector), and then use std::binary_search here. That's likely much faster.
> 
Thanks.


https://reviews.llvm.org/D39694



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

Reply via email to