зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
da5e82f5a3
Коммит
f73c84542c
|
@ -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,
|
||||
|
|
2
array.c
2
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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче