[lld] r230729 - Update comments, fix typos.

Rui Ueyama ruiu at google.com
Thu Feb 26 21:05:28 PST 2015


On Thu, Feb 26, 2015 at 9:00 PM, Davide Italiano <davide at freebsd.org> wrote:

> On Thu, Feb 26, 2015 at 8:23 PM, Rui Ueyama <ruiu at google.com> wrote:
> > Author: ruiu
> > Date: Thu Feb 26 22:23:21 2015
> > New Revision: 230729
>
> [...]
>
> >
> > +  // This is equivalent to strnlen, but we don't use the function
> because
> > +  // it only exists in recent POSIX standards.
> >    size_t len = 0;
> >    size_t e = array.size();
> >    while (len < e && array[len] != '\0')
> >      ++len;
> > +
> >    std::string *contents =
> >        new (_alloc) std::string(reinterpret_cast<const char
> *>(&array[0]), len);
> >    return StringRef(*contents).trim();
> >
>
> Is this newline intentional? If yes, can you explain what's the reason?
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150226/513966a6/attachment.html>


More information about the llvm-commits mailing list