From 70cc2cc173f3ff60150bdb59c0facbea5d1cbe58 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 28 Apr 2023 22:23:53 +0900 Subject: [PATCH] variable.c (iv_rehash): remove unnecessary checks --- src/variable.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/variable.c b/src/variable.c index 24b280630..d3b4f2b48 100644 --- a/src/variable.c +++ b/src/variable.c @@ -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;