mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* hash.c (rb_hash_aset): allow recursive key. [ruby-core:24648]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c9e0df64b5
commit
4067fd028d
2 changed files with 4 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Mar 17 16:25:53 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* hash.c (rb_hash_aset): allow recursive key. [ruby-core:24648]
|
||||
|
||||
Wed Mar 17 06:39:59 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ruby.h (rb_warning, rb_sys_warning): fixed typo in rdoc.
|
||||
|
|
3
hash.c
3
hash.c
|
@ -1096,9 +1096,6 @@ rb_hash_aset(VALUE hash, VALUE key, VALUE val)
|
|||
{
|
||||
rb_hash_modify(hash);
|
||||
hash_update(hash, key);
|
||||
if (hash == key) {
|
||||
rb_raise(rb_eArgError, "recursive key for hash");
|
||||
}
|
||||
if (RHASH(hash)->ntbl->type == &identhash || rb_obj_class(key) != rb_cString) {
|
||||
st_insert(RHASH(hash)->ntbl, key, val);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue