From 25faa74d23108bc9f75e5ca1155b9e6ec3978256 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 2 Dec 2022 07:42:46 +0900 Subject: [PATCH] array.c (mrb_ary_unshift_m): small refactoring Unify size error by `ary_too_big()` function. --- src/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array.c b/src/array.c index a51a285d1..d841a9945 100644 --- a/src/array.c +++ b/src/array.c @@ -715,7 +715,7 @@ mrb_ary_unshift_m(mrb_state *mrb, mrb_value self) } len = ARY_LEN(a); if (alen > ARY_MAX_SIZE - len) { - mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big"); + ary_too_big(mrb); } if (ARY_SHARED_P(a) && a->as.heap.aux.shared->refcnt == 1 /* shared only referenced from this array */