Jeff King wrote:

> --- a/pkt-line.c
> +++ b/pkt-line.c
> @@ -234,9 +234,10 @@ int packet_get_line(struct strbuf *out,
>       *src_len -= 4;
>       len -= 4;
>  
> -     strbuf_add(out, *src_buf, len);
> +     if (out)
> +             strbuf_add(out, *src_buf, len);
> +     packet_trace(*src_buf, len, 0);
>       *src_buf += len;
>       *src_len -= len;
> -     packet_trace(out->buf, out->len, 0);
>       return len;

For what it's worth,
Reviewed-by: Jonathan Nieder <jrnie...@gmail.com>

The above code has a structure of

        prepare to return(buf, len);
        trace(buf, len);

        discard used part of buf;
        return;

which is nice and readable.
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to