mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
move declaration in the middle
This commit is contained in:
+2
-5
@@ -765,13 +765,10 @@ mrb_obj_ivar_set(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value key;
|
||||
mrb_value val;
|
||||
mrb_sym id;
|
||||
|
||||
mrb_get_args(mrb, "oo", &key, &val);
|
||||
mrb_sym id = mrb_to_id(mrb, key);
|
||||
|
||||
//if (!mrb_is_instance_id(id)) {
|
||||
// mrb_name_error(mrb, id, "`%s' is not allowed as an instance variable name", mrb_sym2name(mrb, id));
|
||||
//}
|
||||
id = mrb_to_id(mrb, key);
|
||||
mrb_iv_set(mrb, self, id, val);
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -1976,9 +1976,10 @@ mrb_match_init_copy(mrb_state *mrb, mrb_value obj/*, mrb_value orig*/)
|
||||
mrb_value argv[16];
|
||||
int argc;
|
||||
struct rmatch *rm;
|
||||
mrb_value orig;
|
||||
|
||||
mrb_get_args(mrb, "*", &argv, &argc);
|
||||
mrb_value orig = argv[0];
|
||||
orig = argv[0];
|
||||
|
||||
if (mrb_obj_equal(mrb, obj, orig)) return obj;
|
||||
|
||||
@@ -2006,7 +2007,7 @@ mrb_match_init_copy(mrb_state *mrb, mrb_value obj/*, mrb_value orig*/)
|
||||
rm->char_offset_num_allocated = rm->regs.num_regs;
|
||||
}
|
||||
memcpy(rm->char_offset, RMATCH(orig)->rmatch->char_offset,
|
||||
sizeof(struct rmatch_offset)* rm->regs.num_regs);
|
||||
sizeof(struct rmatch_offset) * rm->regs.num_regs);
|
||||
rm->char_offset_updated = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user