* hash.c (rb_hash_become): should check self-assignment after
conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
70dc199fdd
commit
4d23d9e7d8
@ -1,3 +1,8 @@
|
|||||||
|
Sat Sep 28 13:19:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* hash.c (rb_hash_become): should check self-assignment after
|
||||||
|
conversion.
|
||||||
|
|
||||||
Sat Sep 28 10:40:44 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Sep 28 10:40:44 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* hash.c (rb_hash_become): Hash#become should check added
|
* hash.c (rb_hash_become): Hash#become should check added
|
||||||
|
2
hash.c
2
hash.c
@ -575,8 +575,8 @@ static VALUE
|
|||||||
rb_hash_become(hash, hash2)
|
rb_hash_become(hash, hash2)
|
||||||
VALUE hash, hash2;
|
VALUE hash, hash2;
|
||||||
{
|
{
|
||||||
if (hash == hash2) return hash;
|
|
||||||
hash2 = to_hash(hash2);
|
hash2 = to_hash(hash2);
|
||||||
|
if (hash == hash2) return hash;
|
||||||
rb_hash_clear(hash);
|
rb_hash_clear(hash);
|
||||||
st_foreach(RHASH(hash2)->tbl, replace_i, hash);
|
st_foreach(RHASH(hash2)->tbl, replace_i, hash);
|
||||||
RHASH(hash)->ifnone = RHASH(hash2)->ifnone;
|
RHASH(hash)->ifnone = RHASH(hash2)->ifnone;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user