Commit 80b1c726 authored by Geoff Simmons's avatar Geoff Simmons

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

parent 39bef809
......@@ -42,7 +42,7 @@
* 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.
*/
#define MINSZ (1 << 8)
#define MINBITS (8)
struct ph {
unsigned magic;
......@@ -123,9 +123,9 @@ PH_Generate(char * const * const strings, unsigned n)
bits = lg(n);
if (n != (unsigned)(1 << bits))
bits++;
if (bits < MINBITS)
bits = MINBITS;
sz = 1 << bits;
if (sz < MINSZ)
sz = MINSZ;
mask = sz - 1;
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