[Lldb-commits] [PATCH] D13094: LLDB-MI: Fix assignment operator in CMIUtilString

Eugene Leviant via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 24 07:10:38 PDT 2015


evgeny777 updated this revision to Diff 35620.
evgeny777 added a comment.

Revised, now contains fix for just assignment operation
The "if(vpRhs != nullptr)" was removed to provide the same behaviour for

a) CMIUtilString s  = (char*)nullptr;
b) s = (char*)nullptr;


http://reviews.llvm.org/D13094

Files:
  tools/lldb-mi/MIUtilString.cpp

Index: tools/lldb-mi/MIUtilString.cpp
===================================================================
--- tools/lldb-mi/MIUtilString.cpp
+++ tools/lldb-mi/MIUtilString.cpp
@@ -76,14 +76,7 @@
 //--
 CMIUtilString &CMIUtilString::operator=(const char *vpRhs)
 {
-    if (*this == vpRhs)
-        return *this;
-
-    if (vpRhs != nullptr)
-    {
-        assign(vpRhs);
-    }
-
+    assign(vpRhs);
     return *this;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13094.35620.patch
Type: text/x-patch
Size: 425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150924/532e4cf1/attachment.bin>


More information about the lldb-commits mailing list