1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* hash.c (rb_hash_to_a): specify array capa.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
glass 2013-12-01 05:39:38 +00:00
parent bfbe1b9b31
commit 8efbe96231
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Sun Dec 1 14:37:20 2013 Masaki Matsushita <glass.saga@gmail.com>
* hash.c (rb_hash_to_a): specify array capa.
Sun Dec 1 14:15:36 2013 Masaki Matsushita <glass.saga@gmail.com> Sun Dec 1 14:15:36 2013 Masaki Matsushita <glass.saga@gmail.com>
* hash.c (rb_hash_rehash): fix to free new st_table when exception * hash.c (rb_hash_rehash): fix to free new st_table when exception

2
hash.c
View file

@ -1606,7 +1606,7 @@ rb_hash_to_a(VALUE hash)
{ {
VALUE ary; VALUE ary;
ary = rb_ary_new(); ary = rb_ary_new_capa(RHASH_SIZE(hash));
rb_hash_foreach(hash, to_a_i, ary); rb_hash_foreach(hash, to_a_i, ary);
OBJ_INFECT(ary, hash); OBJ_INFECT(ary, hash);