From 62f5d8394be3efda59807d47c08deec55d2032ae Mon Sep 17 00:00:00 2001 From: Judah Caruso Date: Fri, 30 May 2025 01:00:09 -0600 Subject: [PATCH] change evict to delete in [kv] --- kv/module.jai | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kv/module.jai b/kv/module.jai index 741c706..9dcea6d 100644 --- a/kv/module.jai +++ b/kv/module.jai @@ -45,8 +45,8 @@ set :: (kv: *Kv, key: kv.Key, value: kv.Value) { slot.value = value; } -// @note(judah): we use 'evict' instead of 'remove' because it's a keyword... -evict :: (kv: *Kv, key: kv.Key) -> kv.Value, bool { +// @note(judah): we use 'delete' instead of 'remove' because it's a keyword... +delete :: (kv: *Kv, key: kv.Key) -> kv.Value, bool { slot, ok, idx := find_slot(kv, kv.hash_proc(key)); if !ok return mem.zero_of(kv.Value), false; @@ -145,7 +145,7 @@ hash :: #import "jc/hash"; } for 0..ITERATIONS if it % 2 == 0 { - _, ok := evict(*values, it); + _, ok := delete(*values, it); test.expect(t, ok); } @@ -164,12 +164,12 @@ hash :: #import "jc/hash"; test.expect(t, values.count == 3); test.expect(t, values.slots.allocated == values.number_of_items_to_allocate_initially); - // evicting something that doesn't exist should do nothing - _, ok := evict(*values, 0); + // deleting something that doesn't exist should do nothing + _, ok := delete(*values, 0); test.expect(t, !ok); test.expect(t, values.count == 3); - evict(*values, 2); + delete(*values, 2); test.expect(t, values.count == 2); });