aboutsummaryrefslogtreecommitdiff
path: root/set/set.ha
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst92@gmail.com>2022-05-16 00:35:21 +0200
committerJulian Hurst <julian.hurst92@gmail.com>2022-05-16 00:35:21 +0200
commit9740eee555cac43cc27e08a39a38e09a96ecb002 (patch)
tree555c0fd89906364a8f527c8f1c72ab81b8303adf /set/set.ha
parent35639332a5dc8e9b26e8299c999940a9b6ca2ddb (diff)
downloadilhare-9740eee555cac43cc27e08a39a38e09a96ecb002.tar.gz
Add layout and a common widget type
Diffstat (limited to 'set/set.ha')
-rw-r--r--set/set.ha7
1 files changed, 6 insertions, 1 deletions
diff --git a/set/set.ha b/set/set.ha
index 2c56efe..504d716 100644
--- a/set/set.ha
+++ b/set/set.ha
@@ -33,11 +33,16 @@ export fn contains(s: set, item: size) (size | nosuchitem) = {
return nosuchitem;
};
-// Clears all items
+// Clears all items.
export fn clear(s: *set) void = {
delete(s.items[..]);
};
+// Free the underlying slice.
+export fn finish(s: *set) void = {
+ free(s.items);
+};
+
@test fn add() void = {
let s = set {...};
assert(add(&s, 1z));