[Lldb-commits] [PATCH] D152010: [lldb][NFCI] ConstString methods should take StringRefs by value

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 2 10:24:43 PDT 2023


kastiglione added inline comments.
Herald added a subscriber: JDevlieghere.


================
Comment at: lldb/source/Utility/ConstString.cpp:305
 
-void ConstString::SetString(const llvm::StringRef &s) {
-  m_string = StringPool().GetConstCStringWithLength(s.data(), s.size());
+void ConstString::SetString(const llvm::StringRef s) {
+  m_string = StringPool().GetConstCStringWithStringRef(s);
----------------
I think the `const` can be removed too, since `StringRef`s are immutable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152010



More information about the lldb-commits mailing list