From 3699b61f08848f071de9b52386cd82bb9dd822d6 Mon Sep 17 00:00:00 2001 From: default Date: Mon, 28 Nov 2022 12:19:57 +0100 Subject: [PATCH] Backport from xs. --- xs_set.h | 16 +++++++++++++--- xs_version.h | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/xs_set.h b/xs_set.h index bd1b8ea..5e26abb 100644 --- a/xs_set.h +++ b/xs_set.h @@ -32,11 +32,21 @@ void xs_set_init(xs_set *s) } -void xs_set_free(xs_set *s) -/* frees a set */ +d_char *xs_set_result(xs_set *s) +/* returns the set as a list and frees it */ { + d_char *list = s->list; + s->list = NULL; s->hash = xs_free(s->hash); - s->list = xs_free(s->list); + + return list; +} + + +void xs_set_free(xs_set *s) +/* frees a set, dropping the list */ +{ + free(xs_set_result(s)); } diff --git a/xs_version.h b/xs_version.h index b23be3e..50dd00a 100644 --- a/xs_version.h +++ b/xs_version.h @@ -1 +1 @@ -/* 2c01845d968c01c84aa52ff00ed029d9277c2d9c */ +/* e9effd101e5ad45cc4209759ae25e4a6de9259e8 */