summaryrefslogtreecommitdiff
path: root/xs_set.h
diff options
context:
space:
mode:
authorLouis Brauer <louis77@noreply.codeberg.org>2024-05-25 08:05:36 +0000
committerLouis Brauer <louis77@noreply.codeberg.org>2024-05-25 08:05:36 +0000
commit84a767dd0878013194ed7551b5ae6ef715e841a6 (patch)
tree9fb1b2b89e0bfbb4b8bf1e85d840c8653e646bb7 /xs_set.h
parentcf5718bf4dedb85d2e1a1495f05bfc7e66124022 (diff)
parenta2920800007c291bdf2b5264622cbc713d4961ee (diff)
Merge pull request 'master' (#1) from grunfink/snac2:master into master
Reviewed-on: https://codeberg.org/louis77/snac2/pulls/1
Diffstat (limited to 'xs_set.h')
-rw-r--r--xs_set.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/xs_set.h b/xs_set.h
index 3a334e4..d320d34 100644
--- a/xs_set.h
+++ b/xs_set.h
@@ -85,7 +85,7 @@ int xs_set_add(xs_set *s, const xs_val *data)
{
/* is it 'full'? */
if (s->used >= s->elems / 2) {
- char *p, *v;
+ const xs_val *v;
/* expand! */
s->elems *= 2;
@@ -95,8 +95,8 @@ int xs_set_add(xs_set *s, const xs_val *data)
memset(s->hash, '\0', s->elems * sizeof(int));
/* add the list elements back */
- p = s->list;
- while (xs_list_iter(&p, &v))
+ int ct = 0;
+ while (xs_list_next(s->list, &v, &ct))
_store_hash(s, v, v - s->list);
}
@@ -104,7 +104,7 @@ int xs_set_add(xs_set *s, const xs_val *data)
/* if it's new, add the data */
if (ret)
- s->list = xs_list_append_m(s->list, data, xs_size(data));
+ s->list = xs_list_append(s->list, data);
return ret;
}