On Wed, Jun 10, 2015 at 04:59:58PM +0700, Duy Nguyen wrote: > On Tue, Jun 9, 2015 at 11:28 PM, brian m. carlson > <sandals@xxxxxxxxxxxxxxxxxxxx> 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. I planned on merging the two into has_object_file when has_sha1_file has no more callers, so it's more of an incidental artifact that one calls the other rather than a long-term goal. In the branch I'm working on now, I'm down to 27 callers, so it may be rather soon that it goes away. Of course, if the consensus is that the performance increase is worth it in the mean time, I can certainly just move it back when they merge. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Attachment:
signature.asc
Description: Digital signature