diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-04 00:26:39 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-04 00:26:39 +0100 |
commit | 8225f75cdc56f8efe61efa78237ce3d06f10d3a1 (patch) | |
tree | 9ffd30c56c53a6cae9af6dbb09ce2e493c4400c2 /src | |
parent | another test (diff) | |
download | c-hashtable-8225f75cdc56f8efe61efa78237ce3d06f10d3a1.tar.gz c-hashtable-8225f75cdc56f8efe61efa78237ce3d06f10d3a1.tar.bz2 c-hashtable-8225f75cdc56f8efe61efa78237ce3d06f10d3a1.zip |
take initial capacity in init function
Diffstat (limited to 'src')
-rw-r--r-- | src/main.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index a49db18..3a94dee 100644 --- a/src/main.zig +++ b/src/main.zig @@ -7,7 +7,7 @@ const hashtable = @cImport({ pub fn main() !void { std.debug.print("Testing hashmap!\n", .{}); - var ht = hashtable.hashtable_init(); + var ht = hashtable.hashtable_init(8); defer _ = hashtable.hashtable_deinit(&ht); const Example = struct { @@ -24,7 +24,7 @@ pub fn main() !void { } test "simple test" { - var ht = hashtable.hashtable_init(); + var ht = hashtable.hashtable_init(8); defer _ = hashtable.hashtable_deinit(&ht); const data: i32 = 4; _ = hashtable.hashtable_put(ht, @constCast("key"), @constCast(&data)); @@ -33,7 +33,7 @@ test "simple test" { } test "removing element" { - var ht = hashtable.hashtable_init(); + var ht = hashtable.hashtable_init(8); defer _ = hashtable.hashtable_deinit(&ht); const data: i32 = 4; _ = hashtable.hashtable_put(ht, @constCast("key"), @constCast(&data)); |