From: Duy Nguyen Date: Wed, 10 Jun 2015 09:59:58 GMT Subject: Re: [PATCH 2/8] sha1_file: introduce has_object_file helper. Message-ID: In-Reply-To: <1433867316-663554-3-git-send-email-sandals@crustytoothpaste.net> On Tue, Jun 9, 2015 at 11:28 PM, brian m. carlson wrote: > diff --git a/sha1_file.c b/sha1_file.c > index 7e38148..09f7f03 100644 > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -3173,6 +3173,11 @@ int has_sha1_file(const unsigned char *sha1) > return find_pack_entry(sha1, &e); > } > > +int has_object_file(const struct object_id *oid) > +{ > + return has_sha1_file(oid->hash); > +} > + This version could be "static inline" and placed in cache.h. Though it may be premature optimization. On top of my head I can't recall any place where has_sha1_file() is used so many times for this extra call to become significant overhead. -- Duy