This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Re: Bug in stat()?


On Tue, Apr 30, 2002 at 04:54:18PM -0600, Eric Blake wrote:
> Eric Blake wrote:
> > [...]
> 2002-04-30  Eric Blake  <ebb9@email.byu.edu>
> 
> 	* path.cc (hash_path_name): Improve hash function strength.
> 
> $ diff -u path.cc.bak path.cc
> --- path.cc.bak Tue Apr 30 16:32:52 2002
> +++ path.cc     Tue Apr 30 16:40:14 2002
> @@ -3136,7 +3136,7 @@
>           hash = cygheap->cwd.get_hash ();
>           if (name[0] == '.' && name[1] == '\0')
>             return hash;
> -         hash += hash_path_name (hash, "\\");
> +         hash = (hash << 5) - hash + '\\';
>         }
>      }
> 
> @@ -3146,8 +3146,7 @@
>    do
>      {
>        int ch = cyg_tolower(*name);
> -      hash += ch + (ch << 17);
> -      hash ^= hash >> 2;
> +      hash = (hash << 5) - hash + ch;
>      }
>    while (*++name != '\0' &&
>          !(*name == '\\' && (!name[1] || (name[1] == '.' && !name[2]))));
> 

Thanks for that patch.  I've applied it.  Check out the next
developers snapshot.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]