From 8875e0ca4affbe1c24ed7c13728124e58881061e Mon Sep 17 00:00:00 2001 From: glass Date: Sun, 1 Oct 2017 04:26:25 +0000 Subject: use rb_hash_new_with_size() * hash.c: use rb_hash_new_with_size(). * marshal.c: ditto * struct.c: ditto * vm_args.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index f1f361f953..b36dd37e4b 100644 --- a/struct.c +++ b/struct.c @@ -794,7 +794,7 @@ rb_struct_to_a(VALUE s) static VALUE rb_struct_to_h(VALUE s) { - VALUE h = rb_hash_new(); + VALUE h = rb_hash_new_with_size(RSTRUCT_LEN(s)); VALUE members = rb_struct_members(s); long i; -- cgit v1.2.3