[前][次][番号順一覧][スレッド一覧]

ruby-changes:1822

From: ko1@a...
Date: 30 Aug 2007 09:41:34 +0900
Subject: [ruby-changes:1822] akr - Ruby:r13313 (trunk): * hash.c (hash_alloc0, hash_alloc): unified because hash_alloc doesn't

akr	2007-08-30 09:41:24 +0900 (Thu, 30 Aug 2007)

  New Revision: 13313

  Modified files:
    trunk/ChangeLog
    trunk/hash.c

  Log:
    * hash.c (hash_alloc0, hash_alloc): unified because hash_alloc doesn't
      allocate st_table now.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/hash.c?r1=13313&r2=13312
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13313&r2=13312

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13312)
+++ ChangeLog	(revision 13313)
@@ -10,6 +10,8 @@
 	  (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.
 
Index: hash.c
===================================================================
--- hash.c	(revision 13312)
+++ hash.c	(revision 13313)
@@ -203,7 +203,7 @@
 }
 
 static VALUE
-hash_alloc0(VALUE klass)
+hash_alloc(VALUE klass)
 {
     NEWOBJ(hash, struct RHash);
     OBJSETUP(hash, klass, T_HASH);
@@ -213,16 +213,6 @@
     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 @@
     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);
         }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]