diff options
| author | 2024-03-09 08:58:43 +0100 | |
|---|---|---|
| committer | 2024-03-09 08:58:43 +0100 | |
| commit | 951e6b23151d298d9babeec81bc9926c11bdb3b3 (patch) | |
| tree | f68cc7334f91f7ac8cfa3068798c28e97540952f | |
| parent | Replaced most xs_dict_iter() with xs_dict_next(). (diff) | |
| download | penes-snac2-951e6b23151d298d9babeec81bc9926c11bdb3b3.tar.gz penes-snac2-951e6b23151d298d9babeec81bc9926c11bdb3b3.tar.xz penes-snac2-951e6b23151d298d9babeec81bc9926c11bdb3b3.zip | |
Replaced all xs_dict_iter() with xs_dict_next().
| -rw-r--r-- | http.c | 3 | ||||
| -rw-r--r-- | xs.h | 3 |
2 files changed, 5 insertions, 1 deletions
| @@ -77,7 +77,8 @@ xs_dict *http_signed_request_raw(const char *keyid, const char *seckey, | |||
| 77 | 77 | ||
| 78 | /* transfer the original headers */ | 78 | /* transfer the original headers */ |
| 79 | hdrs = xs_dict_new(); | 79 | hdrs = xs_dict_new(); |
| 80 | while (xs_dict_iter(&headers, &k, &v)) | 80 | int c = 0; |
| 81 | while (xs_dict_next(headers, &k, &v, &c)) | ||
| 81 | hdrs = xs_dict_append(hdrs, k, v); | 82 | hdrs = xs_dict_append(hdrs, k, v); |
| 82 | 83 | ||
| 83 | /* add the new headers */ | 84 | /* add the new headers */ |
| @@ -1028,6 +1028,9 @@ int xs_dict_iter(xs_dict **dict, xs_str **key, xs_val **value) | |||
| 1028 | int xs_dict_next(const xs_dict *dict, xs_str **key, xs_val **value, int *ctxt) | 1028 | int xs_dict_next(const xs_dict *dict, xs_str **key, xs_val **value, int *ctxt) |
| 1029 | /* iterates a dict, with context */ | 1029 | /* iterates a dict, with context */ |
| 1030 | { | 1030 | { |
| 1031 | if (xs_type(dict) != XSTYPE_DICT) | ||
| 1032 | return 0; | ||
| 1033 | |||
| 1031 | int goon = 1; | 1034 | int goon = 1; |
| 1032 | 1035 | ||
| 1033 | char *p = (char *)dict; | 1036 | char *p = (char *)dict; |