aboutsummaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c2
1 files changed, 1 insertions, 1 deletions
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;