diff --git a/ChangeLog b/ChangeLog index 6376e196f2..1f96eb0264 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu May 22 17:18:35 2008 Tanaka Akira + + * array.c (rb_ary_compact_bang): fix reallocation size. + Thu May 22 15:20:20 2008 NAKAMURA Usaku * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h, diff --git a/array.c b/array.c index 2cd3478edb..4cb74ac4f7 100644 --- a/array.c +++ b/array.c @@ -2715,7 +2715,7 @@ rb_ary_compact_bang(VALUE ary) return Qnil; } if (n * 2 < ARY_CAPA(ary) && ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) { - RESIZE_CAPA(ary, ARY_DEFAULT_SIZE * 2); + RESIZE_CAPA(ary, n * 2); } RARRAY(ary)->len = n;