zturner added a subscriber: zturner.
zturner added a comment.

I'm not sure I follow.  `StringRef` is literally just a wrapper around a `const 
char*`, so if `const char*` works, why doesn't `StringRef`?  `JSONParser` 
constructor is already taking a `const char*` in this patch, so it's not like 
it is modifying the contents of the string.

Checking the length and/or getting a substring or trimming values from the 
beginning and end is going to be a far more common operation than converting it 
into something that has to be null terminated (why does it have to be null 
terminated for that matter anyway?), so the benefit of having the length stored 
with the string outweighs the con of having to call `str()` when you want 
something null terminated, IMO


https://reviews.llvm.org/D23884



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

Reply via email to