Subject: Re: [PATCH 8/9] cache-tree: convert struct cache_tree to use object_id

From: Michael Haggerty <[email-masked]>
Date: Tue, 06 May 2014 17:02:40 +0200

On 05/03/2014 10:12 PM, brian m. carlson wrote:
> [...]
> diff --git a/cache-tree.c b/cache-tree.c
> index 7fa524a..b7b2d06 100644
> --- a/cache-tree.c
> +++ b/cache-tree.c

In this file I also found a couple other "20" that could be converted to
GIT_OID_RAWSZ:

Around line 369:
		strbuf_add(&buffer, sha1, 20);

And around line 490 (three instances):
		if (size < 20)
			goto free_return;
		hashcpy(it->sha1, (const unsigned char*)buf);
		buf += 20;
		size -= 20;

I guess a search for "\<[24][0-9]\>" will find most (but not all!) of
the literal constants that are derived from GIT_OID_RAWSZ and GIT_OID_HEXSZ.

Michael

-- 
Michael Haggerty
[email-masked]
http://softwareswirl.blogspot.com/