mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1308 from suzukaze/refactor-hash-c
Refactor mrb_hash_has_keyWithKey() func in hash.c
This commit is contained in:
+2
-7
@@ -925,17 +925,12 @@ 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);
|
||||
result = (k != kh_end(h));
|
||||
return mrb_bool_value(k != kh_end(h));
|
||||
}
|
||||
else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return mrb_bool_value(result);
|
||||
return mrb_false_value();
|
||||
}
|
||||
|
||||
/* 15.2.13.4.13 */
|
||||
|
||||
Reference in New Issue
Block a user