11c1c560b88d430fd2c6967a86d2e87109806357 max Fri Jan 24 09:15:03 2014 -0800 corrections after code review refs #12524. These changes probably don'tneed to reviewed anymore, as Angie has already seen them, I copied them into the ticket #12524. diff --git src/lib/hash.c src/lib/hash.c index 4fe4729..192188c 100644 --- src/lib/hash.c +++ src/lib/hash.c @@ -413,30 +413,45 @@ struct hash *hashFromSlNameList(void *list) /* Create a hash out of a list of slNames or any kind of list where the */ /* first field is the next pointer and the second is the name. */ { struct hash *hash = NULL; struct slName *namedList = list, *item; if (!list) return NULL; hash = newHash(0); for (item = namedList; item != NULL; item = item->next) hashAdd(hash, item->name, item); return hash; } +struct hash *hashSetFromSlNameList(void *list) +/* Create a hashSet (hash with only keys) out of a list of slNames or any kind + * of list where the */ +/* first field is the next pointer and the second is the name. */ +{ +struct hash *hash = NULL; +struct slName *namedList = list, *item; +if (!list) + return NULL; +hash = newHash(0); +for (item = namedList; item != NULL; item = item->next) + hashAdd(hash, item->name, NULL); +return hash; +} + void hashTraverseEls(struct hash *hash, void (*func)(struct hashEl *hel)) /* Apply func to every element of hash with hashEl as parameter. */ { int i; struct hashEl *hel; for (i=0; isize; ++i) { for (hel = hash->table[i]; hel != NULL; hel = hel->next) func(hel); } } void hashTraverseVals(struct hash *hash, void (*func)(void *val)) /* Apply func to every element of hash with hashEl->val as parameter. */ {