mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
variable.c (iv_rehash): remove unnecessary checks
This commit is contained in:
@@ -47,12 +47,10 @@ iv_rehash(mrb_state *mrb, iv_tbl *t)
|
||||
mrb_value *old_ptr = t->ptr;
|
||||
|
||||
khash_power2(new_alloc);
|
||||
if (old_alloc == new_alloc) return;
|
||||
|
||||
t->ptr = (mrb_value*)mrb_calloc(mrb, sizeof(mrb_value)+sizeof(mrb_sym), new_alloc);
|
||||
t->size = 0;
|
||||
t->alloc = new_alloc;
|
||||
if (old_alloc == 0) return;
|
||||
|
||||
mrb_sym *keys = (mrb_sym*)&old_ptr[old_alloc];
|
||||
mrb_value *vals = old_ptr;
|
||||
|
||||
Reference in New Issue
Block a user