projects
/
cgds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add basic Set implementation - TODO: add iterators for Set and HashTable
[cgds.git]
/
src
/
HashTable.c
diff --git
a/src/HashTable.c
b/src/HashTable.c
index
d54934b
..
468de81
100644
(file)
--- a/
src/HashTable.c
+++ b/
src/HashTable.c
@@
-85,9
+85,8
@@
void* _hashtable_get(HashTable* hashTable, char* key)
void _hashtable_set(HashTable* hashTable, char* key, void* data)
{
UInt hashIdx = _compute_hash(key, hashTable->hashSize);
void _hashtable_set(HashTable* hashTable, char* key, void* data)
{
UInt hashIdx = _compute_hash(key, hashTable->hashSize);
- HashCell
- *cell = hashTable->head[hashIdx],
- *prev = NULL;
+ HashCell *cell = hashTable->head[hashIdx],
+ *prev = NULL;
while (cell != NULL)
{
if (strcmp(cell->key, key) == 0)
while (cell != NULL)
{
if (strcmp(cell->key, key) == 0)
@@
-116,9
+115,8
@@
void _hashtable_set(HashTable* hashTable, char* key, void* data)
void hashtable_delete(HashTable* hashTable, char* key)
{
UInt hashIdx = _compute_hash(key, hashTable->hashSize);
void hashtable_delete(HashTable* hashTable, char* key)
{
UInt hashIdx = _compute_hash(key, hashTable->hashSize);
- HashCell
- *cell = hashTable->head[hashIdx],
- *prev = NULL;
+ HashCell *cell = hashTable->head[hashIdx],
+ *prev = NULL;
while (cell != NULL)
{
if (strcmp(cell->key, key) == 0)
while (cell != NULL)
{
if (strcmp(cell->key, key) == 0)