aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-02 12:23:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-02 12:23:17 +0000
commitfdcac03d9e37a4b80f1c4edc20a5944a88421559 (patch)
tree10013564063d5a69c726d560dda969dc0861ed8b /compile.c
parentecce6b524c28ba398105eac554d31a09e2474231 (diff)
downloadruby-fdcac03d9e37a4b80f1c4edc20a5944a88421559.tar.gz
use rb_hash_new_with_size()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 0e56820055..f92eabaa13 100644
--- a/compile.c
+++ b/compile.c
@@ -7203,7 +7203,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
case TS_CDHASH:
{
int i;
- VALUE map = rb_hash_new();
+ VALUE map = rb_hash_new_with_size(RARRAY_LEN(op)/2);
rb_hash_tbl_raw(map)->type = &cdhash_type;
op = rb_convert_type_with_id(op, T_ARRAY, "Array", idTo_ary);
@@ -8525,7 +8525,7 @@ static VALUE
ibf_load_object_hash(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
{
const struct ibf_object_hash *hash = IBF_OBJBODY(struct ibf_object_hash, offset);
- VALUE obj = rb_hash_new();
+ VALUE obj = rb_hash_new_with_size(hash->len);
int i;
for (i=0; i<hash->len; i++) {