src/inc/hash.h 1.48

1.48 2009/04/30 18:12:00 mikep
expanding message which lead to a bug somewhere else
Index: src/inc/hash.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/hash.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -b -B -U 4 -r1.47 -r1.48
--- src/inc/hash.h	10 Jul 2008 23:51:02 -0000	1.47
+++ src/inc/hash.h	30 Apr 2009 18:12:00 -0000	1.48
@@ -132,9 +132,13 @@
 struct hashEl *hashAddSaveName(struct hash *hash, char *name, void *val, char **saveName);
 /* Add new element to hash table.  Save the name of the element, which is now
  * allocated in the hash table, to *saveName.  A typical usage would be:
  *    AllocVar(el);
- *    hashAddSaveName(hash, name, el, &el->name);
+ *    el->val = someVal;
+ *    hashAddSaveName(hash, name, el->val, &el->name);
+ * Note this above code gives you a hashEl 'el' which is not in the hash, but
+ * whose ->name and ->val pointers are the same as the pionters of
+ * the hashEl in the hash.
  */
 
 struct hashEl *hashStore(struct hash *hash, char *name);
 /* If element in hash already return it, otherwise add it