Use mrb_true_or_false_value() / in mrb_hash_has_keyWithKey().

This commit is contained in:
Masaki Muranaka
2013-03-19 10:34:54 +09:00
parent 50ad607e91
commit 615e8560b8
+6 -3
View File
@@ -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 */