commit 3699b61

default  ·  2022-11-28 11:19:57 +0000 UTC
parent f215c1a
Backport from xs.
2 files changed,  +14, -4
+13, -3
 1@@ -32,11 +32,21 @@ void xs_set_init(xs_set *s)
 2 }
 3 
 4 
 5-void xs_set_free(xs_set *s)
 6-/* frees a set */
 7+d_char *xs_set_result(xs_set *s)
 8+/* returns the set as a list and frees it */
 9 {
10+    d_char *list = s->list;
11+    s->list = NULL;
12     s->hash = xs_free(s->hash);
13-    s->list = xs_free(s->list);
14+
15+    return list;
16+}
17+
18+
19+void xs_set_free(xs_set *s)
20+/* frees a set, dropping the list */
21+{
22+    free(xs_set_result(s));
23 }
24 
25 
+1, -1
1@@ -1 +1 @@
2-/* 2c01845d968c01c84aa52ff00ed029d9277c2d9c */
3+/* e9effd101e5ad45cc4209759ae25e4a6de9259e8 */