summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-01 04:26:25 (GMT)
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-01 04:26:25 (GMT)
commit8875e0ca4affbe1c24ed7c13728124e58881061e (patch)
tree088d2d6dc717d99df6fb5eb9a65d41a021464f73 /hash.c
parentcb0f3183cb49a2b5c6df309676d7e558ab074c2c (diff)
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
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index b666fd1..878e215 100644
--- a/hash.c
+++ b/hash.c
@@ -2426,7 +2426,7 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
static VALUE
rb_hash_invert(VALUE hash)
{
- VALUE h = rb_hash_new();
+ VALUE h = rb_hash_new_with_size(RHASH_SIZE(hash));
rb_hash_foreach(hash, rb_hash_invert_i, h);
return h;