mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* hash.c (rb_hash_size): use RHASH_SIZE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
76a400ff71
commit
7a171aa8d1
2 changed files with 5 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Jul 12 00:20:00 2013 Masaki Matsushita <glass.saga@gmail.com>
|
||||
|
||||
* hash.c (rb_hash_size): use RHASH_SIZE().
|
||||
|
||||
Fri Jul 12 00:08:24 2013 Masaki Matsushita <glass.saga@gmail.com>
|
||||
|
||||
* hash.c (rb_hash_values): set array capa to RHASH_SIZE().
|
||||
|
|
4
hash.c
4
hash.c
|
@ -1379,9 +1379,7 @@ rb_hash_replace(VALUE hash, VALUE hash2)
|
|||
static VALUE
|
||||
rb_hash_size(VALUE hash)
|
||||
{
|
||||
if (!RHASH(hash)->ntbl)
|
||||
return INT2FIX(0);
|
||||
return INT2FIX(RHASH(hash)->ntbl->num_entries);
|
||||
return INT2FIX(RHASH_SIZE(hash));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue