diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-30 00:41:24 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-30 00:41:24 +0000 |
| commit | d3f6b7483d52d70f1cf13c1caf1c0f831d2b1166 (patch) | |
| tree | f2589d8813e0d7daff3127a0d82af285d4e1a7a8 | |
| parent | e8673217bebc643b87b0c1607654b7458f962482 (diff) | |
| download | ruby-d3f6b7483d52d70f1cf13c1caf1c0f831d2b1166.tar.gz ruby-d3f6b7483d52d70f1cf13c1caf1c0f831d2b1166.tar.xz ruby-d3f6b7483d52d70f1cf13c1caf1c0f831d2b1166.zip | |
* hash.c (hash_alloc0, hash_alloc): unified because hash_alloc doesn't
allocate st_table now.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | hash.c | 14 |
2 files changed, 4 insertions, 12 deletions
@@ -10,6 +10,8 @@ Thu Aug 30 08:00:12 2007 Tanaka Akira <akr@fsij.org> (RHASH_IFNONE): ditto. (RHASH_SIZE): ditto. (RHASH_EMPTY_P): ditto. + (hash_alloc0, hash_alloc): unified because hash_alloc doesn't + allocate st_table now. * hash.c: delay st_table allocation. @@ -203,7 +203,7 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg) } static VALUE -hash_alloc0(VALUE klass) +hash_alloc(VALUE klass) { NEWOBJ(hash, struct RHash); OBJSETUP(hash, klass, T_HASH); @@ -213,16 +213,6 @@ hash_alloc0(VALUE klass) return (VALUE)hash; } -static VALUE -hash_alloc(VALUE klass) -{ - VALUE hash = hash_alloc0(klass); - - RHASH(hash)->ntbl = 0; - - return hash; -} - VALUE rb_hash_new(void) { @@ -329,7 +319,7 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass) int i; if (argc == 1 && TYPE(argv[0]) == T_HASH) { - hash = hash_alloc0(klass); + hash = hash_alloc(klass); if (RHASH(argv[0])->ntbl) { RHASH(hash)->ntbl = st_copy(RHASH(argv[0])->ntbl); } |
