<div dir="ltr">Presumably you could just "return *this" (or "return StringRef()")<br><br>Perhaps you could test that the allocator is not invoked for that copy operation?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 23, 2016 at 11:36 AM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mehdi, David<br>
<br>
This is a spin off from the discussion on Allocator.h and requesting that we allocate 0 bytes.<br>
<br>
Independent from whatever gets decided on Allocate behaviour, I think it would be best if StringRef::copy returns StringRef(nullptr, 0) whenever we try to copy an empty string.  StringRef(“”) would also be fine if you prefer.<br>
<br>
This makes that change and adds test to the unit test for the new behavior.<br>
<br>
Cheers,<br>
Pete<br>
<br>
</blockquote></div><br></div>