summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--array.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index aa3f3f3..ed37297 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Oct 18 22:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_shift): shorten copy size. fixed: [ruby-list:42907]
+
Wed Oct 18 00:55:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parser_yylex): use particular enums. [ruby-core:09221]
diff --git a/array.c b/array.c
index 2e9d927..acc59d2 100644
--- a/array.c
+++ b/array.c
@@ -502,7 +502,7 @@ rb_ary_shift(ary)
if (RARRAY(ary)->len == 0) return Qnil;
top = RARRAY(ary)->ptr[0];
if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE && !FL_TEST(ary, ELTS_SHARED)) {
- MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary));
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1);
}
else {
if (!FL_TEST(ary, ELTS_SHARED)) {