Re: [PATCH 2/8] sha1_file: introduce has_object_file helper.

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

 



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.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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