diff options
| author | 2024-05-25 08:05:36 +0000 | |
|---|---|---|
| committer | 2024-05-25 08:05:36 +0000 | |
| commit | 84a767dd0878013194ed7551b5ae6ef715e841a6 (patch) | |
| tree | 9fb1b2b89e0bfbb4b8bf1e85d840c8653e646bb7 /xs_set.h | |
| parent | Prevent some browsers from caching servers basic auth request (diff) | |
| parent | Backport from xs (fix regex.h compilation with tcc). (diff) | |
| download | snac2-84a767dd0878013194ed7551b5ae6ef715e841a6.tar.gz snac2-84a767dd0878013194ed7551b5ae6ef715e841a6.tar.xz snac2-84a767dd0878013194ed7551b5ae6ef715e841a6.zip | |
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.h | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -85,7 +85,7 @@ int xs_set_add(xs_set *s, const xs_val *data) | |||
| 85 | { | 85 | { |
| 86 | /* is it 'full'? */ | 86 | /* is it 'full'? */ |
| 87 | if (s->used >= s->elems / 2) { | 87 | if (s->used >= s->elems / 2) { |
| 88 | char *p, *v; | 88 | const xs_val *v; |
| 89 | 89 | ||
| 90 | /* expand! */ | 90 | /* expand! */ |
| 91 | s->elems *= 2; | 91 | s->elems *= 2; |
| @@ -95,8 +95,8 @@ int xs_set_add(xs_set *s, const xs_val *data) | |||
| 95 | memset(s->hash, '\0', s->elems * sizeof(int)); | 95 | memset(s->hash, '\0', s->elems * sizeof(int)); |
| 96 | 96 | ||
| 97 | /* add the list elements back */ | 97 | /* add the list elements back */ |
| 98 | p = s->list; | 98 | int ct = 0; |
| 99 | while (xs_list_iter(&p, &v)) | 99 | while (xs_list_next(s->list, &v, &ct)) |
| 100 | _store_hash(s, v, v - s->list); | 100 | _store_hash(s, v, v - s->list); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| @@ -104,7 +104,7 @@ int xs_set_add(xs_set *s, const xs_val *data) | |||
| 104 | 104 | ||
| 105 | /* if it's new, add the data */ | 105 | /* if it's new, add the data */ |
| 106 | if (ret) | 106 | if (ret) |
| 107 | s->list = xs_list_append_m(s->list, data, xs_size(data)); | 107 | s->list = xs_list_append(s->list, data); |
| 108 | 108 | ||
| 109 | return ret; | 109 | return ret; |
| 110 | } | 110 | } |