diff --git a/array.c b/array.c index a59cb6c3e9..c5d7274272 100644 --- a/array.c +++ b/array.c @@ -2180,7 +2180,7 @@ static VALUE rb_ary_to_h(VALUE ary) { long i; - VALUE hash = rb_hash_new(); + VALUE hash = rb_hash_new_with_size(RARRAY_LEN(ary)); for (i=0; i