<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 26, 2015 at 9:00 PM, Davide Italiano <span dir="ltr"><<a href="mailto:davide@freebsd.org" target="_blank">davide@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Thu, Feb 26, 2015 at 8:23 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br>
> Author: ruiu<br>
> Date: Thu Feb 26 22:23:21 2015<br>
> New Revision: 230729<br>
<br>
</span>[...]<br>
<span><br>
><br>
> +  // This is equivalent to strnlen, but we don't use the function because<br>
> +  // it only exists in recent POSIX standards.<br>
>    size_t len = 0;<br>
>    size_t e = array.size();<br>
>    while (len < e && array[len] != '\0')<br>
>      ++len;<br>
> +<br>
>    std::string *contents =<br>
>        new (_alloc) std::string(reinterpret_cast<const char *>(&array[0]), len);<br>
>    return StringRef(*contents).trim();<br>
><br>
<br>
</span>Is this newline intentional? If yes, can you explain what's the reason?<br>
</blockquote></div><br></div><div class="gmail_extra">It's a minor difference, but yes, it's intentional. I added a comment saying that that piece of code is equivalent to strnlen. If I didn't add a blank line there, it's not clear where is end of strnlen-equivalent code.</div></div>