summaryrefslogtreecommitdiff
path: root/id_table.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-02-08 09:43:39 -0500
committerPeter Zhu <[email protected]>2024-02-12 15:07:47 -0500
commitea92374bf727325fe96b5f65a41cdc1fc147af9e (patch)
tree71beb07b24627447fdd6d78c71ad5cd6137356fd /id_table.c
parent436191abe05a12be17bb6c184790ee39d6fabffb (diff)
Replace assert with RUBY_ASSERT in id_table.c
assert does not print the bug report, only the file and line number of the assertion that failed. RUBY_ASSERT prints the full bug report, which makes it much easier to debug.
Diffstat (limited to 'id_table.c')
-rw-r--r--id_table.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/id_table.c b/id_table.c
index 650721c670..6bb067d09a 100644
--- a/id_table.c
+++ b/id_table.c
@@ -150,7 +150,7 @@ hash_table_raw_insert(struct rb_id_table *tbl, id_key_t key, VALUE val)
int mask = tbl->capa - 1;
int ix = key & mask;
int d = 1;
- assert(key != 0);
+ RUBY_ASSERT(key != 0);
while (ITEM_KEY_ISSET(tbl, ix)) {
ITEM_SET_COLLIDED(tbl, ix);
ix = (ix + d) & mask;
@@ -276,7 +276,7 @@ rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, v
if (ITEM_KEY_ISSET(tbl, i)) {
const id_key_t key = ITEM_GET_KEY(tbl, i);
enum rb_id_table_iterator_result ret = (*func)(key2id(key), tbl->items[i].val, data);
- assert(key != 0);
+ RUBY_ASSERT(key != 0);
if (ret == ID_TABLE_DELETE)
hash_delete_index(tbl, i);