Re: [PATCH 1/7] commit: provide a function to find a header in a buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 22, 2014 at 09:26:44PM -0400, Eric Sunshine wrote:

> > +               if (line == eol)
> > +                       return NULL;
> > +               next = *eol ? eol + 1 : NULL;
> > +
> > +               if (eol - line > key_len &&
> > +                   !strncmp(line, key, key_len) &&
> > +                   line[key_len] == ' ') {
> > +                       *out_len = eol - line - key_len - 1;
> > +                       return line + key_len + 1;
> > +               }
> > +               line = next;
> 
> This is already simplified from the original implementation in
> get_header(), but it can be simplified further by dropping 'next',
> which is not otherwise used, and assigning 'line' directly:
> 
>     line = *eol ? eol + 1 : NULL;

Yeah, you're right. Squashed, thanks.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]