<div dir="ltr">Looks good - thanks!<br><br>(you might be able to write "(size-t)0" as "0u" instead)</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 23, 2016 at 2:22 PM, 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"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Mar 23, 2016, at 1:57 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Presumably you could just "return *this" (or "return StringRef()”)<br></div></div></blockquote></span>Ah yeah, StringRef() is better than what I had. I do personally prefer it over ‘*this’ just because I like that data() will be nullptr.<span class=""><br><blockquote type="cite"><div><div dir="ltr"><br>Perhaps you could test that the allocator is not invoked for that copy operation?</div></div></blockquote></span><div>Good point. Added that now.</div><div><br></div><div>Cheers</div><span class="HOEnZb"><font color="#888888"><div>Pete</div><br><blockquote type="cite"><div><div dir="ltr"></div></div></blockquote></font></span></div></div><br><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"></div></div></blockquote><blockquote type="cite"><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>
</div></blockquote></div><br></div><br></blockquote></div><br></div>