scott.linder added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp:99-103
+      size_t NewlinePos = PD->getShortDescription().find_first_of('\n');
+      if (NewlinePos != std::string::npos)
+        OutStr = PD->getShortDescription().str().insert(NewlinePos, 
WarningMsg);
+      else
+        OutStr = (PD->getShortDescription() + WarningMsg).str();
----------------
scott.linder wrote:
> It's frustrating that `std::string::insert` doesn't follow the pattern of 
> `npos==end-of-string`, but I'd still suggest only doing the actual 
> insert/append once
Or to be more precise, I would try to only have one piece of code doing the 
insert/append


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127923

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

Reply via email to