On Mon, Jun 24, 2013 at 10:15:31AM -0000, danie...@apache.org wrote:
> Author: danielsh
> Date: Mon Jun 24 10:15:31 2013
> New Revision: 1495978
> 
> URL: http://svn.apache.org/r1495978
> Log:
> Silence a compiler warning.
> 
> * subversion/libsvn_fs_fs/tree.c
>   (cache_lookup): Only declare FACTOR when it is used.
> 
> Modified:
>     subversion/trunk/subversion/libsvn_fs_fs/tree.c
> 
> Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1495978&r1=1495977&r2=1495978&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Mon Jun 24 10:15:31 2013
> @@ -342,8 +342,10 @@ cache_lookup( fs_fs_dag_cache_t *cache
>    apr_size_t path_len = strlen(path);
>    apr_uint32_t hash_value = (apr_uint32_t)revision;
>  
> +#if SVN_UNALIGNED_ACCESS_IS_OK
>    /* "randomizing" / distributing factor used in our hash function */
>    const apr_uint32_t factor = 0xd1f3da69;
> +#endif
>  

Is this the right fix?  Right now, the !SVN_UNALIGNED_ACCESS_IS_OK hash
function is just (x[n] + 33^1 x[n-1] + ... + 33^(n-1) x[1] + 33^n x[0]).

Daniel

>    /* optimistic lookup: hit the same bucket again? */
>    cache_entry_t *result = &cache->buckets[cache->last_hit];
> 
> 

Reply via email to