OSDN Git Service

* path.cc (hash_path_name): Replace hash algorithm with SDBM.
authorcorinna <corinna>
Thu, 8 Apr 2004 12:21:15 +0000 (12:21 +0000)
committercorinna <corinna>
Thu, 8 Apr 2004 12:21:15 +0000 (12:21 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index bfbb95f..f3e6817 100644 (file)
@@ -1,4 +1,8 @@
-2004-04-07  Corinna Vinschen  <corinna@vinschen.de>
+2004-04-08  Corinna Vinschen  <corinna@vinschen.de>
+
+       * path.cc (hash_path_name): Replace hash algorithm with SDBM.
+
+2004-04-08  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler.cc (fhandler_base::open): Set query access mode according
        to query_open setting.
index 0ece42d..847fbd0 100644 (file)
@@ -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]))));