Re: [PATCH v2.1 3/4] describe: Store commit_names in a hash table by commit SHA1
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 8, 2010, 22:50 UTC
- Message-ID
- <7v1v5rkhfb.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.2.02.1012081319320.23348@dr-wily.mit.edu>
Anders Kaseorg <andersk@ksplice.com> writes:
Show 8 quoted lines
> @@ -44,6 +47,19 @@ static const char *prio_names[] = {
> "head", "lightweight", "annotated",
> };
>
> +static inline unsigned int hash_sha1(const unsigned char *sha1)
> +{
> + return *(unsigned int *)sha1;
> +}Do we know that all the archs we will be compiled on will be happy with this potentially unaligned access? hash_filespec() in diffcore-rename.c is written in a way to avoid such an issue, and I would feel safer to see this do the same.