From 60990b9a167d744176e35e9185fb477d81a4d3e7 Mon Sep 17 00:00:00 2001 From: stomar Date: Fri, 12 Oct 2018 19:56:53 +0000 Subject: [PATCH] hash.c: improve docs for Hash#{size,length} * hash.c: [DOC] shorten example code for Hash#{size,length} and mention aliases at the end; also enable links. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hash.c b/hash.c index ba6053dbfc..6a67bc676f 100644 --- a/hash.c +++ b/hash.c @@ -1731,15 +1731,14 @@ rb_hash_replace(VALUE hash, VALUE hash2) * hsh.size -> integer * * Returns the number of key-value pairs in the hash. - * Hash#length and Hash#size are both equivalent to - * each other. * * h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 } - * h.length #=> 4 * h.size #=> 4 * h.delete("a") #=> 200 - * h.length #=> 3 * h.size #=> 3 + * h.length #=> 3 + * + * Hash#length is an alias for Hash#size. */ VALUE