[DOC] Tweaks for Hash#empty?

This commit is contained in:
Burdette Lamar 2025-02-18 14:29:27 -06:00 committed by GitHub
parent fd134cf6d2
commit 27ba268b75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2025-02-18 20:29:44 +00:00
Merged: https://github.com/ruby/ruby/pull/12775

Merged-By: peterzhu2118 <peter@peterzhu.ca>

5
hash.c
View File

@ -3017,8 +3017,11 @@ rb_hash_size_num(VALUE hash)
* empty? -> true or false * empty? -> true or false
* *
* Returns +true+ if there are no hash entries, +false+ otherwise: * Returns +true+ if there are no hash entries, +false+ otherwise:
*
* {}.empty? # => true * {}.empty? # => true
* {foo: 0, bar: 1, baz: 2}.empty? # => false * {foo: 0}.empty? # => false
*
* Related: see {Methods for Querying}[rdoc-ref:Hash@Methods+for+Querying].
*/ */
VALUE VALUE