Re: [PATCH 1/3] pkt-line: teach packet_get_line a no-op mode

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

 



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 <jrnieder@xxxxxxxxx>

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 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]