diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-24 18:09:04 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-24 18:09:04 +0900 |
| commit | cb5c9d34150c073b5cdde725cadd959839c9bc45 (patch) | |
| tree | 93a90f83c8d62538ef2b92550ed76ea4c0f64b2a /src | |
| parent | 23c73ff3998782f5e2a7f1f3755fddf8ceed0d30 (diff) | |
| download | mruby-cb5c9d34150c073b5cdde725cadd959839c9bc45.tar.gz mruby-cb5c9d34150c073b5cdde725cadd959839c9bc45.zip | |
always call Hash#default if no key found; fix #3272
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/hash.c b/src/hash.c index 015b2d614..4df2babbe 100644 --- a/src/hash.c +++ b/src/hash.c @@ -172,11 +172,8 @@ mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key) } /* not found */ - if (MRB_RHASH_DEFAULT_P(hash)) { - /* xxx mrb_funcall_tailcall(mrb, hash, "default", 1, key); */ - return mrb_funcall(mrb, hash, "default", 1, key); - } - return mrb_nil_value(); + /* xxx mrb_funcall_tailcall(mrb, hash, "default", 1, key); */ + return mrb_funcall(mrb, hash, "default", 1, key); } MRB_API mrb_value |
