diff --git a/array.c b/array.c index bd323cd6b0..edac2169f9 100644 --- a/array.c +++ b/array.c @@ -4096,7 +4096,7 @@ ary_slice_bang_by_rb_ary_splice(VALUE ary, long pos, long len) else if (orig_len < pos) { return Qnil; } - else if (orig_len < pos + len) { + if (orig_len < pos + len) { len = orig_len - pos; } if (len == 0) {