aboutsummaryrefslogtreecommitdiff
path: root/xs_json.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-08-30 19:10:26 +0200
committerdefault <nobody@localhost>2024-08-30 19:10:26 +0200
commit0218e964b0d73340c8d0c5d9e37991359d7c4be9 (patch)
tree9cfc1650abf8780be52dc219e37a311244a294e2 /xs_json.h
parentbff33fc2eda701ff5d6cd8433c15dfd9aca768f7 (diff)
Backport from xs.
Diffstat (limited to 'xs_json.h')
-rw-r--r--xs_json.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/xs_json.h b/xs_json.h
index 3a91de9..de9600f 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -75,7 +75,6 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f)
/* dumps partial data as JSON */
{
int c = 0;
- int ct = 0;
const xs_val *v;
switch (xs_type(data)) {
@@ -98,7 +97,7 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f)
case XSTYPE_LIST:
fputc('[', f);
- while (xs_list_next(data, &v, &ct)) {
+ xs_list_foreach(data, v) {
if (c != 0)
fputc(',', f);
@@ -118,7 +117,7 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f)
const xs_str *k;
- while (xs_dict_next(data, &k, &v, &ct)) {
+ xs_dict_foreach(data, k, v) {
if (c != 0)
fputc(',', f);