proc.h: remove MRB_METHOD_NOARG flag; derive from aspec

The NOARG flag (bit 2) is now redundant since the full aspec is
stored in bits 4+ of the flags field. Replace the dedicated bit
check with aspec==0 check. Store aspec in define_method_id() for
dynamically defined methods too.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-02-20 11:51:59 +09:00
parent 483c155a41
commit ada229d2b0
4 changed files with 16 additions and 26 deletions
+1 -3
View File
@@ -1052,9 +1052,7 @@ define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func,
int ai = mrb_gc_arena_save(mrb);
MRB_METHOD_FROM_FUNC(m, func);
if (aspec == MRB_ARGS_NONE()) {
MRB_METHOD_NOARG_SET(m);
}
m.flags |= (aspec << 4);
MRB_METHOD_SET_VISIBILITY(m, vis);
mrb_define_method_raw(mrb, c, mid, m);
mrb_gc_arena_restore(mrb, ai);