Просмотр исходного кода

Increase filesdb bin size, and alter hashing function.

Adam Heath лет назад: 23
Родитель
Сommit
1efdbb2808
3 измененных файлов с 9 добавлено и 2 удалено
  1. 4 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 2 2
      main/filesdb.c

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Sat Sep 13 16:09:13 CDT 2003 Adam Heath <doogie@debian.org>
+
+  * main/filesdb.c: Increase filesdb bin size, and alter hashing function.
+
 Sat Sep 13 16:04:37 CDT 2003 Adam Heath <doogie@debian.org>
 Sat Sep 13 16:04:37 CDT 2003 Adam Heath <doogie@debian.org>
 
 
   * scripts/dpkg-statoverride.pl: Fix "stripping trailing /" message from
   * scripts/dpkg-statoverride.pl: Fix "stripping trailing /" message from

+ 3 - 0
debian/changelog

@@ -29,6 +29,9 @@ dpkg (1.10.11) unstable; urgency=low
   * Joey Hess <joeyh@debian.org>:
   * Joey Hess <joeyh@debian.org>:
     Fix "stripping trailing /" message from dpkg-statoverride.  Closes:
     Fix "stripping trailing /" message from dpkg-statoverride.  Closes:
     #203782
     #203782
+  * Sami Liedes <sliedes@cc.hut.fi>:
+    Increase filesdb bin size, and alter hashing function.  Closes:
+    #179385
 
 
  -- Wichert Akkerman <debian@extern.wiggy.net>  UNRELEASED
  -- Wichert Akkerman <debian@extern.wiggy.net>  UNRELEASED
 
 

+ 2 - 2
main/filesdb.c

@@ -520,7 +520,7 @@ struct fileiterator {
   int nbinn;
   int nbinn;
 };
 };
 
 
-#define BINS (1 << 13)
+#define BINS (1 << 17)
  /* This must always be a power of two.  If you change it
  /* This must always be a power of two.  If you change it
   * consider changing the per-character hashing factor (currently
   * consider changing the per-character hashing factor (currently
   * 1785 = 137*13) too.
   * 1785 = 137*13) too.
@@ -566,7 +566,7 @@ void filesdbinit(void) {
 
 
 static int hash(const char *name) {
 static int hash(const char *name) {
   int v= 0;
   int v= 0;
-  while (*name) { v *= 1785; v += *name; name++; }
+  while (*name) { v *= 1787; v += *name; name++; }
   return v;
   return v;
 }
 }