From 27c2f9ac380bfb6733d96c4766764d7790d2717e Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 8 Jan 2024 07:23:03 +0900 Subject: [PATCH] mruby-random (mrb_ary_sample): reduce the scope of loop variables --- mrbgems/mruby-random/src/random.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mrbgems/mruby-random/src/random.c b/mrbgems/mruby-random/src/random.c index c47702e94..025c4f369 100644 --- a/mrbgems/mruby-random/src/random.c +++ b/mrbgems/mruby-random/src/random.c @@ -344,19 +344,18 @@ mrb_ary_sample(mrb_state *mrb, mrb_value ary) } else { mrb_value result; - mrb_int i, j; if (n < 0) mrb_raise(mrb, E_ARGUMENT_ERROR, "negative sample number"); if (n > len) n = len; result = mrb_ary_new_capa(mrb, n); - for (i=0; i