diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-10-12 08:25:54 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-10-12 08:25:54 +0900 |
| commit | 82e00ce60f358489ae2c3a7fdbe4da9bf264b286 (patch) | |
| tree | 16f26e6a8b6538465574b663bbc8a35bff1252a9 /src | |
| parent | a690aef8d3219e3123822e741e2bb7c97220425c (diff) | |
| download | mruby-82e00ce60f358489ae2c3a7fdbe4da9bf264b286.tar.gz mruby-82e00ce60f358489ae2c3a7fdbe4da9bf264b286.zip | |
`Hash#delete` should return the deleted value; fix #4133
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c index 21dc846af..5bccb3091 100644 --- a/src/hash.c +++ b/src/hash.c @@ -460,7 +460,7 @@ sg_del(mrb_state *mrb, seglist *t, mrb_value key, mrb_value *vp) } key2 = seg->e[i].key; if (!mrb_undef_p(key2) && sg_hash_equal(mrb, t, key, key2)) { - if (vp) *vp = key2; + if (vp) *vp = seg->e[i].val; seg->e[i].key = mrb_undef_value(); t->size--; return TRUE; |
