diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | array.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Thu May 22 17:18:35 2008 Tanaka Akira <akr@fsij.org> + + * array.c (rb_ary_compact_bang): fix reallocation size. + Thu May 22 15:20:20 2008 NAKAMURA Usaku <usa@ruby-lang.org> * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h, @@ -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; |