@@ -581,14 +581,16 @@ mrb_ary_shift(mrb_state *mrb, mrb_value self)
|
581 | 581 | static mrb_value |
582 | 582 | mrb_ary_shift_m(mrb_state *mrb, mrb_value self) |
583 | 583 | { |
584 | | -struct RArray *a = mrb_ary_ptr(self); |
585 | | -mrb_int len = ARY_LEN(a); |
586 | 584 | mrb_int n; |
587 | | -mrb_value val; |
588 | 585 | |
589 | 586 | if (mrb_get_args(mrb, "|i", &n) == 0) { |
590 | 587 | return mrb_ary_shift(mrb, self); |
591 | | - }; |
| 588 | + } |
| 589 | + |
| 590 | +struct RArray *a = mrb_ary_ptr(self); |
| 591 | +mrb_int len = ARY_LEN(a); |
| 592 | +mrb_value val; |
| 593 | + |
592 | 594 | ary_modify_check(mrb, a); |
593 | 595 | if (len == 0 || n == 0) return mrb_ary_new(mrb); |
594 | 596 | if (n < 0) mrb_raise(mrb, E_ARGUMENT_ERROR, "negative array shift"); |
|