1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix wrong documentation

It doesn't return `nil` but raises an exception, as explained a few lines after
This commit is contained in:
romainsalles 2021-04-23 14:25:42 +02:00 committed by Marc-André Lafortune
parent 71ee05c936
commit 7de7d096e7
Notes: git 2021-04-24 01:25:35 +09:00

1
hash.c
View file

@ -2120,7 +2120,6 @@ rb_hash_lookup(VALUE hash, VALUE key)
* If +key+ is not found and no block was given,
* returns +default_value+:
* {}.fetch(:nosuch, :default) # => :default
* {}.fetch(:nosuch) # => nil
*
* If +key+ is not found and a block was given,
* yields +key+ to the block and returns the block's return value: