mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Refactor mrb_hash_empty_p() func in hash.c
This commit is contained in:
+2
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user