Re: [PATCH v2 01/10] packfile: move sizep computation

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

 



On Fri, Aug 23, 2024 at 10:46:21PM +0000, Eric Wong wrote:
> From: Jeff King <peff@xxxxxxxx>
>
> Moving the sizep computation now makes the next commit to avoid
> redundant object info lookups easier to understand.  There is
> no user-visible change, here.
>
> [ew: commit message]
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> Signed-off-by: Eric Wong <e@xxxxxxxxx>
> ---
>  packfile.c | 32 ++++++++++++++++----------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/packfile.c b/packfile.c
> index 813584646f..4028763947 100644
> --- a/packfile.c
> +++ b/packfile.c
> @@ -1536,24 +1536,24 @@ int packed_object_info(struct repository *r, struct packed_git *p,
>  			type = OBJ_BAD;
>  	} else {
>  		type = unpack_object_header(p, &w_curs, &curpos, &size);
> -	}

Omitted from the context here is that the "if" statement which this
"else" belongs to is "if (oi->contentp)", so placing the "if
(oi->sizep)" conditional within the else block is equivalent to the
pre-image as you suggest.

With that additional detail, this patch looks obviously correct to me.

Thanks,
Taylor




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

  Powered by Linux