mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use mrb_true_or_false_value() / in mrb_hash_has_keyWithKey().
This commit is contained in:
+6
-3
@@ -1013,14 +1013,17 @@ mrb_hash_has_keyWithKey(mrb_state *mrb, mrb_value hash, mrb_value key)
|
||||
{
|
||||
khash_t(ht) *h = RHASH_TBL(hash);
|
||||
khiter_t k;
|
||||
mrb_bool result;
|
||||
|
||||
if (h) {
|
||||
k = kh_get(ht, h, key);
|
||||
if (k != kh_end(h))
|
||||
return mrb_true_value();
|
||||
result = (k != kh_end(h));
|
||||
}
|
||||
else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return mrb_false_value();
|
||||
return mrb_true_or_false_value(result);
|
||||
}
|
||||
|
||||
/* 15.2.13.4.13 */
|
||||
|
||||
Reference in New Issue
Block a user