summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index 19d0507e3..777d5fc1a 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -1037,7 +1037,7 @@ mrb_hash_values(mrb_state *mrb, mrb_value hash)
{
khash_t(ht) *h = RHASH_TBL(hash);
khiter_t k;
- mrb_value ary = mrb_ary_new(mrb);
+ mrb_value ary = mrb_ary_new_capa(mrb, kh_size(h));
if (!h) return ary;
for (k = kh_begin(h); k != kh_end(h); k++) {