Improve performance of hash (for use as dictionary keys)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21691 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-08-31 09:34:33 +00:00
parent 643c232713
commit d7dcbb06b7
4 changed files with 66 additions and 3 deletions

View file

@ -121,7 +121,7 @@
val.d = [self doubleValue];
for (i = 0; i < sizeof(double); i++)
{
hash += val.c[i];
hash = (hash << 5) + hash + val.c[i];
}
return hash;
}