From 00e7474ccefb0104a2c0bef738e0392932902172 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 25 Oct 2025 23:27:08 +0900 Subject: [PATCH] array.c: combine variable declaration with initialization --- src/array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/array.c b/src/array.c index fd043786a..1be41baad 100644 --- a/src/array.c +++ b/src/array.c @@ -1124,7 +1124,6 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val mrb_int alen = ARY_LEN(a); const mrb_value *argv; mrb_int argc; - mrb_int tail; ary_modify(mrb, a); @@ -1140,7 +1139,8 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val out_of_range: mrb_raisef(mrb, E_INDEX_ERROR, "index %i is out of array", head); } - tail = head + len; + + mrb_int tail = head + len; if (alen < len || alen < tail) { len = alen - head; tail = head + len;