Extract frozen checking to function

This commit is contained in:
KOBAYASHI Shuji
2019-04-09 18:23:11 +09:00
parent ec1688807e
commit e3beef065c
8 changed files with 20 additions and 30 deletions
+1 -3
View File
@@ -120,9 +120,7 @@ ary_fill_with_nil(mrb_value *ptr, mrb_int size)
static void
ary_modify_check(mrb_state *mrb, struct RArray *a)
{
if (MRB_FROZEN_P(a)) {
mrb_raise(mrb, E_FROZEN_ERROR, "can't modify frozen array");
}
mrb_check_frozen(mrb, a);
}
static void