summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-04-27 08:05:43 +0200
committerJean Boussier <[email protected]>2025-04-27 11:59:28 +0200
commit3ec7bfff2e7ac4f6f69d26676edcfd2e73ea3b05 ()
treee5f836790fc027fb7d30bb6388f10ae4464b6e40 /vm_insnhelper.c
parent6874b289a199db74fac4126cbefe7cfac491cda0 (diff)
Use a `set_table` for `rb_vm_struct.unused_block_warning_table`
Now that we have a hash-set implementation we can use that instead of a hash-table with a static value.
-rw-r--r--vm_insnhelper.c6
1 files changed, 3 insertions, 3 deletions
@@ -3034,7 +3034,7 @@ static void
warn_unused_block(const rb_callable_method_entry_t *cme, const rb_iseq_t *iseq, void *pc)
{
rb_vm_t *vm = GET_VM();
- st_table *dup_check_table = vm->unused_block_warning_table;
st_data_t key;
bool strict_unused_block = rb_warning_category_enabled_p(RB_WARN_CATEGORY_STRICT_UNUSED_BLOCK);
@@ -3051,7 +3051,7 @@ warn_unused_block(const rb_callable_method_entry_t *cme, const rb_iseq_t *iseq,
if (!strict_unused_block) {
key = (st_data_t)cme->def->original_id;
- if (st_lookup(dup_check_table, key, NULL)) {
return;
}
}
@@ -3071,7 +3071,7 @@ warn_unused_block(const rb_callable_method_entry_t *cme, const rb_iseq_t *iseq,
}
// duplication check
- if (st_insert(dup_check_table, key, 1)) {
// already shown
}
else if (RTEST(ruby_verbose) || strict_unused_block) {