diff options
| author | Yukihiro Matz Matsumoto <[email protected]> | 2012-11-04 05:02:39 +0900 |
|---|---|---|
| committer | Yukihiro Matz Matsumoto <[email protected]> | 2012-11-04 05:02:39 +0900 |
| commit | d2d2e9f5f9267c2583aa542b4066d109a07b742e (patch) | |
| tree | c9c5747bfbb489c063ad72e4d68b0de3e818ac1f /src/hash.c | |
| parent | 051777dc5de7e16ab28d39530fc0bb8101323e2c (diff) | |
| download | mruby-d2d2e9f5f9267c2583aa542b4066d109a07b742e.tar.gz mruby-d2d2e9f5f9267c2583aa542b4066d109a07b742e.zip | |
add new predicates mrb_string_p(),mrb_array_p(),mrb_hash_p()
Diffstat (limited to 'src/hash.c')
| -rw-r--r-- | src/hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hash.c b/src/hash.c index 51f85f4e8..229e61db7 100644 --- a/src/hash.c +++ b/src/hash.c @@ -37,7 +37,7 @@ static void mrb_hash_modify(mrb_state *mrb, mrb_value hash); static inline mrb_value mrb_hash_ht_key(mrb_state *mrb, mrb_value key) { - if (mrb_type(key) == MRB_TT_STRING) + if (mrb_string_p(key)) return mrb_str_dup(mrb, key); else return key; @@ -1106,7 +1106,7 @@ hash_equal(mrb_state *mrb, mrb_value hash1, mrb_value hash2, int eql) khash_t(ht) *h1, *h2; if (mrb_obj_equal(mrb, hash1, hash2)) return mrb_true_value(); - if (mrb_type(hash2) != MRB_TT_HASH) { + if (!mrb_hash_p(hash2)) { if (!mrb_respond_to(mrb, hash2, mrb_intern(mrb, "to_hash"))) { return mrb_false_value(); } |
