ruby-changes:31483
From: glass <ko1@a...>
Date: Thu, 7 Nov 2013 10:37:40 +0900 (JST)
Subject: [ruby-changes:31483] glass:r43562 (trunk): * array.c (rb_ary_sample): use rb_ary_dup().
glass 2013-11-07 10:37:34 +0900 (Thu, 07 Nov 2013) New Revision: 43562 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43562 Log: * array.c (rb_ary_sample): use rb_ary_dup(). Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 43561) +++ array.c (revision 43562) @@ -4596,8 +4596,7 @@ rb_ary_sample(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/array.c#L4596 }); } else { - result = rb_ary_subseq(ary, 0, len); - rb_ary_modify(result); + result = rb_ary_dup(ary); RBASIC_CLEAR_CLASS(result); RB_GC_GUARD(ary); RARRAY_PTR_USE(result, ptr_result, { Index: ChangeLog =================================================================== --- ChangeLog (revision 43561) +++ ChangeLog (revision 43562) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Nov 7 10:34:12 2013 Masaki Matsushita <glass.saga@g...> + + * array.c (rb_ary_sample): use rb_ary_dup(). + Thu Nov 7 09:39:41 2013 Nobuyoshi Nakada <nobu@r...> * vm_trace.c (rb_threadptr_exec_event_hooks_orig): errinfo should not -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/