ruby-changes:12441
From: matz <ko1@a...>
Date: Thu, 16 Jul 2009 14:10:35 +0900 (JST)
Subject: [ruby-changes:12441] Ruby:r24141 (trunk): * array.c (rb_ary_sample): RDoc update. a patch from Florian
matz 2009-07-16 14:10:18 +0900 (Thu, 16 Jul 2009) New Revision: 24141 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24141 Log: * array.c (rb_ary_sample): RDoc update. a patch from Florian Frank. [ruby-core:24347] Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 24140) +++ array.c (revision 24141) @@ -3526,9 +3526,11 @@ * array.sample -> obj * array.sample(n) -> an_array * - * Choose a random element, or the random +n+ elements, from the array. - * If the array is empty, the first form returns <code>nil</code>, and the - * second form returns an empty array. + * Choose a random element or +n+ random elements from the array. The elements + * are chosen by using random and unique indices into the array in order to + * ensure that an element doesn't repeat itself unless the array already + * contained duplicate elements. If the array is empty the first form returns + * <code>nil</code> and the second form returns an empty array. * */ Index: ChangeLog =================================================================== --- ChangeLog (revision 24140) +++ ChangeLog (revision 24141) @@ -1,3 +1,8 @@ +Thu Jul 16 14:08:44 2009 Yukihiro Matsumoto <matz@r...> + + * array.c (rb_ary_sample): RDoc update. a patch from Florian + Frank. [ruby-core:24347] + Thu Jul 16 12:42:10 2009 NARUSE, Yui <naruse@r...> * ext/readline/readline.c (readline_readline): rl_free_line_state -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/