<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 23, 2016, at 2:23 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Looks good - thanks!<br class=""></div></div></blockquote>Thanks for the review.  r264201.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class="">(you might be able to write "(size-t)0" as "0u" instead)</div></div></blockquote>Funnily enough I thought about doing this but then got myself convinced that targets might exists where size_t isn’t unsigned.  Anyway, I’m obviously being stupid here so committed with 0u.</div><div><br class=""></div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Mar 23, 2016 at 2:22 PM, Pete Cooper <span dir="ltr" class=""><<a href="mailto:peter_cooper@apple.com" target="_blank" class="">peter_cooper@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Mar 23, 2016, at 1:57 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Presumably you could just "return *this" (or "return StringRef()”)<br class=""></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 class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class="">Perhaps you could test that the allocator is not invoked for that copy operation?</div></div></blockquote></span><div class="">Good point.  Added that now.</div><div class=""><br class=""></div><div class="">Cheers</div><span class="HOEnZb"><font color="#888888" class=""><div class="">Pete</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""></div></div></blockquote></font></span></div></div><br class=""><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""></div></div></blockquote><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Mar 23, 2016 at 11:36 AM, Pete Cooper <span dir="ltr" class=""><<a href="mailto:peter_cooper@apple.com" target="_blank" class="">peter_cooper@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mehdi, David<br class="">
<br class="">
This is a spin off from the discussion on Allocator.h and requesting that we allocate 0 bytes.<br class="">
<br class="">
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 class="">
<br class="">
This makes that change and adds test to the unit test for the new behavior.<br class="">
<br class="">
Cheers,<br class="">
Pete<br class="">
<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div><br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>