Commit 347e78c0 authored by Geoff Simmons's avatar Geoff Simmons

Correcty set the table size and bits for the minimum size.

parent 6d1aa9cf
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* sets, if the tables are about as small as the set. Tests have never * sets, if the tables are about as small as the set. Tests have never
* shown hash generation failure when the tables have this minimum size. * shown hash generation failure when the tables have this minimum size.
*/ */
#define MINSZ (1 << 8) #define MINBITS (8)
struct ph { struct ph {
unsigned magic; unsigned magic;
...@@ -123,9 +123,9 @@ PH_Generate(char * const * const strings, unsigned n) ...@@ -123,9 +123,9 @@ PH_Generate(char * const * const strings, unsigned n)
bits = lg(n); bits = lg(n);
if (n != (unsigned)(1 << bits)) if (n != (unsigned)(1 << bits))
bits++; bits++;
if (bits < MINBITS)
bits = MINBITS;
sz = 1 << bits; sz = 1 << bits;
if (sz < MINSZ)
sz = MINSZ;
mask = sz - 1; mask = sz - 1;
errno = 0; errno = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment