summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-04-08 12:21:15 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-04-08 12:21:15 +0000
commit6eee18ea6e55b33da482df2c34ddb9547751e49a (patch)
treea46a440cf6512a305b146896cd62c2fc3866ec5b /winsup/cygwin/path.cc
parenta9a5b2eab006f3479087bed7030a16b86cd791aa (diff)
downloadcygnal-6eee18ea6e55b33da482df2c34ddb9547751e49a.tar.gz
cygnal-6eee18ea6e55b33da482df2c34ddb9547751e49a.tar.bz2
cygnal-6eee18ea6e55b33da482df2c34ddb9547751e49a.zip
* path.cc (hash_path_name): Replace hash algorithm with SDBM.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 0ece42dd9..847fbd0c6 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3262,7 +3262,7 @@ hash_path_name (__ino64_t hash, const char *name)
hash = cygheap->cwd.get_hash ();
if (name[0] == '.' && name[1] == '\0')
return hash;
- hash = (hash << 5) - hash + '\\';
+ hash = '\\' + (hash << 6) + (hash << 16) - hash;
}
}
@@ -3272,7 +3272,7 @@ hashit:
do
{
int ch = cyg_tolower (*name);
- hash = (hash << 5) - hash + ch;
+ hash = ch + (hash << 6) + (hash << 16) - hash;
}
while (*++name != '\0' &&
!(*name == '\\' && (!name[1] || (name[1] == '.' && !name[2]))));