variable.c (iv_rehash): remove unnecessary checks

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-04-28 22:23:53 +09:00
parent 5024c3453d
commit 70cc2cc173
-2
View File
@@ -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;