evgeny777 added inline comments.

================
Comment at: tools/lldb-mi/MIUtilString.cpp:41
@@ -40,3 +40,3 @@
 CMIUtilString::CMIUtilString(const char *vpData)
-    : std::string(vpData)
+    : std::string(vpData != nullptr ? vpData : "")
 {
----------------
ki.stfu wrote:
> Not sure about usefulness of these changes. The NULL usually means an error 
> in contrast to "" which means "there is nothing to show". In your case, you 
> can check whether it's NULL or not, and then construct an object.
> 
> Besides that, you can use operator=:
> ```
> SBValue val;
> CMIUtilString s;
> if (const char* s_cstr = val.GetSummary())
>   s = s_cstr;
> ```
As I already said, in MI both NULL and "" mean nothing to output. Regarding 
your proposal compare this


```
CMIUtilString s;
if (const char* ss = val.GetSummary())  {
    if ((s=ss).size()) {
    }

}
```
with this 

```
if ( (s = val.GetSummary()).size() ) {
}
```



http://reviews.llvm.org/D13094



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to