Improved speed of creating new hash tables

This commit is contained in:
Christopher Aue
2017-08-04 22:08:29 +02:00
parent 1b9c4855a3
commit 0e5c3c4ebd
+1 -4
View File
@@ -145,10 +145,7 @@ mrb_hash_new_capa(mrb_state *mrb, mrb_int capa)
struct RHash *h;
h = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class);
h->ht = kh_init(ht, mrb);
if (capa > 0) {
kh_resize(ht, mrb, h->ht, capa);
}
h->ht = kh_init_size(ht, mrb, capa);
h->iv = 0;
return mrb_obj_value(h);
}