summaryrefslogtreecommitdiffhomepage
path: root/src/array.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-04-10 06:03:32 +0900
committerGitHub <[email protected]>2019-04-10 06:03:32 +0900
commitd0b30f4ce22e7f9e2396a2159d1a1ff81fcc6ca6 (patch)
treec4670a8bd9ad3aa93a92e3e603f8b26589d7504b /src/array.c
parentb433001a1b0676b1bfbd9850c51fd8caed2c8c7b (diff)
parente3beef065c2de80a843f329599b424676d83086c (diff)
downloadmruby-d0b30f4ce22e7f9e2396a2159d1a1ff81fcc6ca6.tar.gz
mruby-d0b30f4ce22e7f9e2396a2159d1a1ff81fcc6ca6.zip
Merge pull request #4367 from shuujii/extract-frozen-checking-to-function
Extract frozen checking to function
Diffstat (limited to 'src/array.c')
-rw-r--r--src/array.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/array.c b/src/array.c
index 43f4c98b5..d4302cb22 100644
--- a/src/array.c
+++ b/src/array.c
@@ -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