commit 951e6b2

default  ·  2024-03-09 07:58:43 +0000 UTC
parent 91bb061
Replaced all xs_dict_iter() with xs_dict_next().
2 files changed,  +5, -1
M http.c
M xs.h
M http.c
+2, -1
 1@@ -77,7 +77,8 @@ xs_dict *http_signed_request_raw(const char *keyid, const char *seckey,
 2 
 3     /* transfer the original headers */
 4     hdrs = xs_dict_new();
 5-    while (xs_dict_iter(&headers, &k, &v))
 6+    int c = 0;
 7+    while (xs_dict_next(headers, &k, &v, &c))
 8         hdrs = xs_dict_append(hdrs, k, v);
 9 
10     /* add the new headers */
M xs.h
+3, -0
 1@@ -1028,6 +1028,9 @@ int xs_dict_iter(xs_dict **dict, xs_str **key, xs_val **value)
 2 int xs_dict_next(const xs_dict *dict, xs_str **key, xs_val **value, int *ctxt)
 3 /* iterates a dict, with context */
 4 {
 5+    if (xs_type(dict) != XSTYPE_DICT)
 6+        return 0;
 7+
 8     int goon = 1;
 9 
10     char *p = (char *)dict;