From d7796855b87911b8ae6c726ab5df4949f173dbd2 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Mon, 16 Sep 2024 00:26:51 -0400 Subject: [lldb] Nits on uses of llvm::raw_string_ostream (NFC) (#108745) As specified in the docs, 1) raw_string_ostream is always unbuffered and 2) the underlying buffer may be used directly ( 65b13610a5226b84889b923bae884ba395ad084d for further reference ) * Don't call raw_string_ostream::flush(), which is essentially a no-op. * Avoid unneeded calls to raw_string_ostream::str(), to avoid excess indirection. --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 271ff61..d5dfe79 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -5360,7 +5360,7 @@ std::string ProcessGDBRemote::HarmonizeThreadIdsForProfileData( output_stream << end_delimiter; m_thread_id_to_used_usec_map = new_thread_id_to_used_usec_map; - return output_stream.str(); + return output; } void ProcessGDBRemote::HandleStopReply() { -- cgit v1.1