diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-17 09:38:10 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-17 09:38:10 +0000 |
| commit | 5008f85e0564e76f379bc07b7f30f7efc8e02d2a (patch) | |
| tree | f79b454b1c6352c12dae4915f0e136c228d71a9f /hash.c | |
| parent | eb0970089c9874da15f8adc6e0a719fc0b131e5b (diff) | |
| download | ruby-5008f85e0564e76f379bc07b7f30f7efc8e02d2a.tar.gz ruby-5008f85e0564e76f379bc07b7f30f7efc8e02d2a.tar.xz ruby-5008f85e0564e76f379bc07b7f30f7efc8e02d2a.zip | |
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
| -rw-r--r-- | hash.c | 24 |
1 files changed, 1 insertions, 23 deletions
@@ -265,27 +265,6 @@ rb_hash_clone(hash) } static VALUE -rb_hash_dup(hash) - VALUE hash; -{ - VALUE klass = CLASS_OF(hash); - - NEWOBJ(dup, struct RHash); - while (TYPE(klass) == T_ICLASS || FL_TEST(klass, FL_SINGLETON)) { - klass = (VALUE)RCLASS(klass)->super; - } - OBJSETUP(dup, klass, T_HASH); - - dup->iter_lev = 0; - dup->ifnone = RHASH(hash)->ifnone; - dup->tbl = 0; /* avoid GC crashing */ - dup->tbl = (st_table*)st_copy(RHASH(hash)->tbl); - - if (OBJ_TAINTED(hash)) OBJ_TAINT(dup); - return (VALUE)dup; -} - -static VALUE to_hash(hash) VALUE hash; { @@ -489,7 +468,7 @@ static VALUE rb_hash_reject(hash) VALUE hash; { - return rb_hash_delete_if(rb_hash_dup(hash)); + return rb_hash_delete_if(rb_obj_dup(hash)); } static int @@ -1417,7 +1396,6 @@ Init_Hash() rb_define_method(rb_cHash,"initialize", rb_hash_initialize, -1); rb_define_method(rb_cHash,"clone", rb_hash_clone, 0); - rb_define_method(rb_cHash,"dup", rb_hash_dup, 0); rb_define_method(rb_cHash,"rehash", rb_hash_rehash, 0); rb_define_method(rb_cHash,"to_hash", rb_hash_to_hash, 0); |
