mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
+1
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user