[Commit] nickle ChangeLog,1.29,1.30 hash.c,1.5,1.6

Bart Massey commit at keithp.com
Wed Apr 14 22:37:38 PDT 2004


Committed by: bart

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv21635

Modified Files:
	ChangeLog hash.c 
Log Message:
2004-04-14  Bart Massey  <bart at cs.pdx.edu>

	reviewed by: Keith Packard <keithp at keithp.com>

	* hash.c: (HashGet), (HashSet):
	Make hash table grow when full on get of
	default value.  Clean boundary case in
	test in HashSet.  Keithp really did this.



Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- a/ChangeLog	11 Apr 2004 09:33:25 -0000	1.29
+++ b/ChangeLog	15 Apr 2004 05:37:36 -0000	1.30
@@ -1,3 +1,12 @@
+2004-04-14  Bart Massey  <bart at cs.pdx.edu>
+
+	reviewed by: Keith Packard <keithp at keithp.com>
+
+	* hash.c: (HashGet), (HashSet):
+	Make hash table grow when full on get of
+	default value.  Clean boundary case in
+	test in HashSet.  Keithp really did this.
+
 2004-04-11  Bart Massey  <bart at cs.pdx.edu>
 
 	* string.5c: (split):

Index: hash.c
===================================================================
RCS file: /local/src/CVS/nickle/hash.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- a/hash.c	11 Apr 2004 06:06:52 -0000	1.5
+++ b/hash.c	15 Apr 2004 05:37:36 -0000	1.6
@@ -316,6 +316,11 @@
 				    "uninitialized hash element", 0);
 	    return (Void);
 	}
+	if (ht->count >= ht->hashSet->entries && 
+	    ht->hashSet != &hashSets[NHASHSETS - 1])
+	{
+	    Resize (ht, ht->hashSet + 1);
+	}
 	ht->count++;
 	HashEltHash(he) = hash;
 	HashEltKey(he) = key;
@@ -331,7 +336,7 @@
     Value	    hash = ValueHash (key);
     Value	    *he;
 
-    if (ht->count == ht->hashSet->entries && 
+    if (ht->count >= ht->hashSet->entries && 
 	ht->hashSet != &hashSets[NHASHSETS - 1])
     {
 	Resize (ht, ht->hashSet + 1);




More information about the Commit mailing list