mruby · GitHub

Commit 5970e35

matzclaude

and

committed

class.c: skip keyword argument hash duplication in mrb_get_args()

Same reasoning as the vm.c change - the keyword hash arriving at C functions via mrb_get_args() is always freshly constructed at the call site, so duplication is unnecessary. Co-authored-by: Claude <noreply@anthropic.com>

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src

Lines changed: 1 addition & 1 deletion

Original file line numberDiff line numberDiff line change

@@ -1633,7 +1633,7 @@ get_args_v(mrb_state *mrb, mrb_args_format format, void** ptr, va_list *ap)

16331633
16341634

case ':':

16351635

{

1636-

mrb_value ksrc = mrb_hash_p(kdict) ? mrb_hash_dup(mrb, kdict) : mrb_hash_new(mrb);

1636+

mrb_value ksrc = mrb_hash_p(kdict) ? kdict : mrb_hash_new(mrb);

16371637

const mrb_kwargs *kwargs = GET_ARG(const mrb_kwargs*);

16381638

mrb_value *rest;

16391639

0 commit comments

Comments

 (0)

Read the original on github.com ↗