Permalink
Browse files

Avoid inline local variable declarations; fix #3554

  • Loading branch information...
matz committed Mar 28, 2017
1 parent 1bdaf9c commit 5ec051fc34a380687cbca463228131b013aa8db2
Showing with 3 additions and 3 deletions.
  1. +3 −3 mrbgems/mruby-array-ext/src/array.c
@@ -174,7 +174,7 @@ static mrb_value
mrb_ary_slice_bang(mrb_state *mrb, mrb_value self)
{
struct RArray *a = mrb_ary_ptr(self);
mrb_int i, len;
mrb_int i, j, k, len;
mrb_value index;
mrb_value val;
mrb_value *ptr;
@@ -210,12 +210,12 @@ mrb_ary_slice_bang(mrb_state *mrb, mrb_value self)
ary = mrb_ary_new_capa(mrb, len);
for (mrb_int j = i, k = 0; k < len; ++j, ++k) {
for (j = i, k = 0; k < len; ++j, ++k) {
mrb_ary_push(mrb, ary, a->ptr[j]);
}
ptr = a->ptr + i;
for (mrb_int j = i; j <= a->len - len; ++j) {
for (j = i; j <= a->len - len; ++j) {
*ptr = *(ptr+len);
++ptr;
}

0 comments on commit 5ec051f

Please sign in to comment.