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

================
Comment at: clang-tools-extra/clangd/Preamble.cpp:351
   auto PreambleContents =
-      llvm::MemoryBuffer::getMemBufferCopy(Contents.substr(0, Bounds.Size));
+      llvm::MemoryBuffer::getMemBufferCopy(PI.Contents.substr(0, Bounds.Size));
   auto Clang = prepareCompilerInstance(
----------------
hokein wrote:
> Looks like we have an extra cost here -- the std::string.substr will 
> construct a new string everytime, we could save it by using 
> `llvm::StringRef(PI.Contents).substr(0, Bounds.Size)`.
thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144708

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

Reply via email to