diff options
author | linus <linus> | 2010-03-08 21:54:42 +0000 |
---|---|---|
committer | linus <linus@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2010-03-08 21:54:42 +0000 |
commit | d3815dfd3e7f48e0c47499acc173809d973a4ad6 (patch) | |
tree | eb7ab3b1d45ef8ff35c7d083ad781d86af9daa2c /hash.c | |
parent | 317902cef5ff7e15e9e2a9758764b5a04b9634ac (diff) |
Reindent and remove trailing whitespace.
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@517 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -29,7 +29,7 @@ struct hash *hash_create() { /* frees all memory associated with the hash */ void hash_destroy(struct hash *h) { struct list_node *ln; - + if (!h) return; for (ln = list_first(h->hashlist); ln; ln = list_next(ln)) { @@ -73,15 +73,15 @@ int hash_insert(struct hash *h, void *key, uint32_t keylen, void *data) { void *hash_read(struct hash *h, void *key, uint32_t keylen) { struct list_node *ln; struct hash_entry *e; - + if (!h) return 0; pthread_mutex_lock(&h->mutex); for (ln = list_first(h->hashlist); ln; ln = list_next(ln)) { e = (struct hash_entry *)ln->data; if (e->keylen == keylen && !memcmp(e->key, key, keylen)) { - pthread_mutex_unlock(&h->mutex); - return e->data; + pthread_mutex_unlock(&h->mutex); + return e->data; } } pthread_mutex_unlock(&h->mutex); @@ -92,7 +92,7 @@ void *hash_read(struct hash *h, void *key, uint32_t keylen) { void *hash_extract(struct hash *h, void *key, uint32_t keylen) { struct list_node *ln; struct hash_entry *e; - + if (!h) return 0; pthread_mutex_lock(&h->mutex); |