Commit c963855a authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1314 from suzukaze/refactor-hash-c

Refactor mrb_hash_empty_p() func in hash.c
parents 18121fba 0e5ecae3
......@@ -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