[Lldb-commits] [lldb] [lldb][NFC] Remove temp allocation SBCommandReturnObject::PutCString (PR #173365)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 5 07:42:51 PST 2026


================
@@ -315,8 +315,8 @@ void SBCommandReturnObject::PutCString(const char *string, int len) {
   if (len == 0 || string == nullptr || *string == 0) {
     return;
   } else if (len > 0) {
-    std::string buffer(string, len);
-    ref().AppendMessage(buffer.c_str());
+    const llvm::StringRef buffer{string, static_cast<size_t>(len)};
----------------
da-viper wrote:

using the `{ }` does not implicitly convert arguments `int -> size_t`, but will update it to `()` 

https://github.com/llvm/llvm-project/pull/173365


More information about the lldb-commits mailing list