Commit 0e5c3c4e authored by Christopher Aue's avatar Christopher Aue

Improved speed of creating new hash tables

parent 1b9c4855
...@@ -145,10 +145,7 @@ mrb_hash_new_capa(mrb_state *mrb, mrb_int capa) ...@@ -145,10 +145,7 @@ mrb_hash_new_capa(mrb_state *mrb, mrb_int capa)
struct RHash *h; struct RHash *h;
h = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class); h = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class);
h->ht = kh_init(ht, mrb); h->ht = kh_init_size(ht, mrb, capa);
if (capa > 0) {
kh_resize(ht, mrb, h->ht, capa);
}
h->iv = 0; h->iv = 0;
return mrb_obj_value(h); return mrb_obj_value(h);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment