diff options
| author | KOBAYASHI Shuji <[email protected]> | 2020-05-09 15:27:42 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2020-05-09 15:27:42 +0900 |
| commit | 181f7b97d6b5ac76d64e5457f28916b92aada619 (patch) | |
| tree | cc46954707c28a5baacce3d1f64551fd230cf615 /include/mruby.h | |
| parent | 3491372a1d9e4fde2551442cf0aeb1ffae888547 (diff) | |
| download | mruby-181f7b97d6b5ac76d64e5457f28916b92aada619.tar.gz mruby-181f7b97d6b5ac76d64e5457f28916b92aada619.zip | |
Fix some `Hash` methods are inconsistent with `values`
Inconsistent when hash has duplicate key.
### Example
```ruby
# example.rb
keys = (1..3).map{[_1]}
h = keys.to_h{[_1, _1[0]]}
keys[0][0] = 2
p h.values
p h.each_value.to_a
p h
```
#### Before this patch:
```console
$ bin/mruby example.rb
[1, 2, 3]
[1, 1, 3]
{[2]=>1, [2]=>1, [3]=>3}
```
#### After this patch (same as Ruby)
```console
$ bin/mruby example.rb
[1, 2, 3]
[1, 2, 3]
{[2]=>1, [2]=>2, [3]=>3}
```
Diffstat (limited to 'include/mruby.h')
0 files changed, 0 insertions, 0 deletions
