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

ruby-changes:31117

From: nobu <ko1@a...>
Date: Tue, 8 Oct 2013 15:35:45 +0900 (JST)
Subject: [ruby-changes:31117] nobu:r43196 (trunk): array.c: set class

nobu	2013-10-08 15:35:29 +0900 (Tue, 08 Oct 2013)

  New Revision: 43196

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43196

  Log:
    array.c: set class
    
    * array.c (rb_ary_uniq): set class of the return value to the receiver
      class.  fix failure in TestArray#test_array_subclass.

  Modified files:
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 43195)
+++ array.c	(revision 43196)
@@ -4131,6 +4131,7 @@ rb_ary_uniq(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L4131
 	hash = ary_make_hash(ary);
 	uniq = rb_hash_keys(hash);
     }
+    RBASIC_SET_CLASS(uniq, rb_obj_class(ary));
     ary_recycle_hash(hash);
 
     return uniq;

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

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