ruby-changes:8528
From: mame <ko1@a...>
Date: Thu, 30 Oct 2008 21:35:29 +0900 (JST)
Subject: [ruby-changes:8528] Ruby:r20062 (trunk, ruby_1_9_1): * array.c (rb_ary_permutation): hide temporal array.
mame 2008-10-30 21:35:04 +0900 (Thu, 30 Oct 2008) New Revision: 20062 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20062 Log: * array.c (rb_ary_permutation): hide temporal array. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/array.c trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 20061) +++ array.c (revision 20062) @@ -3461,12 +3461,14 @@ volatile VALUE t1 = tmpbuf(n,sizeof(int)); int *used = (int*)RSTRING_PTR(t1); VALUE ary0 = ary_make_substitution(ary); /* private defensive copy of ary */ + RBASIC(ary0)->klass = 0; for (i = 0; i < n; i++) used[i] = 0; /* initialize array */ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */ RB_GC_GUARD(t0); RB_GC_GUARD(t1); + RBASIC(ary0)->klass = rb_cArray; } return ary; } Index: ChangeLog =================================================================== --- ChangeLog (revision 20061) +++ ChangeLog (revision 20062) @@ -1,3 +1,7 @@ +Thu Oct 30 21:32:15 2008 Yusuke Endoh <mame@t...> + + * array.c (rb_ary_permutation): hide temporal array. + Thu Oct 30 14:45:45 2008 Martin Duerst <duerst@i...> * enc/trans/single_byte.trans: refactoring to make it easier Index: ruby_1_9_1/array.c =================================================================== --- ruby_1_9_1/array.c (revision 20061) +++ ruby_1_9_1/array.c (revision 20062) @@ -3463,12 +3463,14 @@ volatile VALUE t1 = tmpbuf(n,sizeof(int)); int *used = (int*)RSTRING_PTR(t1); VALUE ary0 = ary_make_substitution(ary); /* private defensive copy of ary */ + RBASIC(ary0)->klass = 0; for (i = 0; i < n; i++) used[i] = 0; /* initialize array */ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */ RB_GC_GUARD(t0); RB_GC_GUARD(t1); + RBASIC(ary0)->klass = rb_cArray; } return ary; } Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20061) +++ ruby_1_9_1/ChangeLog (revision 20062) @@ -1,3 +1,7 @@ +Thu Oct 30 21:32:15 2008 Yusuke Endoh <mame@t...> + + * array.c (rb_ary_permutation): hide temporal array. + Thu Oct 30 09:31:45 2008 Nobuyoshi Nakada <nobu@r...> * encoding.c (rb_locale_encoding): makes an alias for locale. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/