Re: [PATCH 4/5] tree-walk: store object_id in a separate member

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

 



On Thu, Jan 10, 2019 at 01:49:45AM -0500, Jeff King wrote:
> This one really is a hashcpy() now, right, even after your final patch?
> I guess using rawsz explicitly makes it match the computation here:
> 
> > @@ -107,7 +108,7 @@ static void entry_extract(struct tree_desc *t, struct name_entry *a)
> >  static int update_tree_entry_internal(struct tree_desc *desc, struct strbuf *err)
> >  {
> >  	const void *buf = desc->buffer;
> > -	const unsigned char *end = desc->entry.oid->hash + the_hash_algo->rawsz;
> > +	const unsigned char *end = (const unsigned char *)desc->entry.path + desc->entry.pathlen + 1 + the_hash_algo->rawsz;
> >  	unsigned long size = desc->size;
> >  	unsigned long len = end - (const unsigned char *)buf;
> 
> So maybe it's better to be explicit as you have here. (Mostly just as I
> was reading it, I was looking for a use of hashcpy and was surprised not
> to find it ;) ).

Yeah, I think a hashcpy is a better choice. Will fix.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[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