LegalizeAdulthood added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/ClangTidyCheck.cpp:56
 ClangTidyCheck::OptionsView::get(StringRef LocalName) const {
-  const auto &Iter = CheckOptions.find(NamePrefix + LocalName.str());
+  const auto &Iter = CheckOptions.find((NamePrefix + LocalName).str());
   if (Iter != CheckOptions.end())
----------------
njames93 wrote:
> LegalizeAdulthood wrote:
> > `find` takes a `StringRef` so why convert to `std::string` here?
> Because a concatenation of StringRef results in a Twine, which cannot be 
> passed to find.
Interactions between `std::string`, `StringRef` and `Twine` always make my 
brain hurt `:)`.

I keep wondering if there's a way to make `StringRef` and `Twine` more 
user-friendly, or perhaps a clang-tidy check that will alert you to things  
that are "considered harmful".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124341/new/

https://reviews.llvm.org/D124341

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

Reply via email to