summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-22 08:19:04 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-22 08:19:04 +0000
commitf73c84542c5a7462c12118ec56b459660636f903 (patch)
tree67cb88645eb3da6b3e4edfccdbf91bcc4831ee4a /array.c
parentda5e82f5a353745c17d726a86379c17797e7be73 (diff)
* array.c (rb_ary_compact_bang): fix reallocation size.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
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;