зеркало из https://github.com/github/ruby.git
* hash.c (recursive_hash): hash value of emptied hash should be
equal to an empty hash. [ruby-core:38650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
48fd404ffe
Коммит
86bbfdadf3
|
@ -1,3 +1,8 @@
|
|||
Tue Aug 2 12:03:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* hash.c (recursive_hash): hash value of emptied hash should be
|
||||
equal to an empty hash. [ruby-core:38650]
|
||||
|
||||
Tue Aug 2 11:42:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]
|
||||
|
|
1
hash.c
1
hash.c
|
@ -1685,6 +1685,7 @@ recursive_hash(VALUE hash, VALUE dummy, int recur)
|
|||
if (!RHASH(hash)->ntbl)
|
||||
return LONG2FIX(0);
|
||||
hval = RHASH(hash)->ntbl->num_entries;
|
||||
if (!hval) return LONG2FIX(0);
|
||||
if (recur)
|
||||
hval = rb_hash_uint(rb_hash_start(rb_hash(rb_cHash)), hval);
|
||||
else
|
||||
|
|
|
@ -809,6 +809,9 @@ class TestHash < Test::Unit::TestCase
|
|||
|
||||
def test_hash2
|
||||
assert_kind_of(Integer, {}.hash)
|
||||
h = {1=>2}
|
||||
h.shift
|
||||
assert_equal({}.hash, h.hash, '[ruby-core:38650]')
|
||||
end
|
||||
|
||||
def test_update2
|
||||
|
|
Загрузка…
Ссылка в новой задаче