mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-25 03:51:26 +00:00
Some hashtable changes
This commit is contained in:
parent
32c928ab6d
commit
9c0231a58e
1 changed files with 2 additions and 2 deletions
4
util.c
4
util.c
|
@ -593,11 +593,11 @@ void util_htset(hash_table_t *ht, const char *key, void *value) {
|
|||
bin = _util_hthash(ht, key);
|
||||
next = ht->table[bin];
|
||||
|
||||
while (next && next->key && strcmp(key, next->key))
|
||||
while (next && next->key && strcmp(key, next->key) > 0)
|
||||
last = next, next = next->next;
|
||||
|
||||
/* already in table, do a replace */
|
||||
if (next && next->key && !strcmp(key, next->key)) {
|
||||
if (next && next->key && !strcmp(key, next->key) == 0) {
|
||||
next->value = value;
|
||||
} else {
|
||||
/* not found, grow a pair man :P */
|
||||
|
|
Loading…
Reference in a new issue