[Lldb-commits] [lldb] def72b9 - [lldb/Interpreter] Remove redundant argument (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 2 21:23:27 PDT 2020


Author: Jonas Devlieghere
Date: 2020-06-02T21:23:19-07:00
New Revision: def72b91950d44a68b8613f25fa1a09926171222

URL: https://github.com/llvm/llvm-project/commit/def72b91950d44a68b8613f25fa1a09926171222
DIFF: https://github.com/llvm/llvm-project/commit/def72b91950d44a68b8613f25fa1a09926171222.diff

LOG: [lldb/Interpreter] Remove redundant argument (NFC)

Added: 
    

Modified: 
    lldb/source/Interpreter/CommandReturnObject.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Interpreter/CommandReturnObject.cpp b/lldb/source/Interpreter/CommandReturnObject.cpp
index efeac6d6c90e..a0ede4588291 100644
--- a/lldb/source/Interpreter/CommandReturnObject.cpp
+++ b/lldb/source/Interpreter/CommandReturnObject.cpp
@@ -14,12 +14,9 @@
 using namespace lldb;
 using namespace lldb_private;
 
-static void DumpStringToStreamWithNewline(Stream &strm, const std::string &s,
-                                          bool add_newline_if_empty) {
+static void DumpStringToStreamWithNewline(Stream &strm, const std::string &s) {
   bool add_newline = false;
-  if (s.empty()) {
-    add_newline = add_newline_if_empty;
-  } else {
+  if (!s.empty()) {
     // We already checked for empty above, now make sure there is a newline in
     // the error, and if there isn't one, add one.
     strm.Write(s.c_str(), s.size());
@@ -50,7 +47,7 @@ void CommandReturnObject::AppendErrorWithFormat(const char *format, ...) {
   if (!s.empty()) {
     Stream &error_strm = GetErrorStream();
     error_strm.PutCString("error: ");
-    DumpStringToStreamWithNewline(error_strm, s, false);
+    DumpStringToStreamWithNewline(error_strm, s);
   }
 }
 


        


More information about the lldb-commits mailing list