Commit 0e5ecae3 authored by Jun Hiroe's avatar Jun Hiroe

Refactor mrb_hash_empty_p() func in hash.c

parent b44309b4
......@@ -776,16 +776,9 @@ mrb_value
mrb_hash_empty_p(mrb_state *mrb, mrb_value self)
{
khash_t(ht) *h = RHASH_TBL(self);
mrb_bool empty_p;
if (h) {
empty_p = (kh_size(h) == 0);
}
else {
empty_p = 1;
}
return mrb_bool_value(empty_p);
if (h) return mrb_bool_value(kh_size(h) == 0);
return mrb_true_value();
}
static mrb_value
......
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