* array.c (rb_ary_sample): RDoc update. a patch from Florian

Frank.   [ruby-core:24347]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-07-16 05:10:18 +00:00
Родитель 606ea39a3b
Коммит 57264a4fae
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Thu Jul 16 14:08:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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@ruby-lang.org>
* ext/readline/readline.c (readline_readline): rl_free_line_state

Просмотреть файл

@ -3526,9 +3526,11 @@ rb_ary_shuffle(VALUE ary)
* 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.
*
*/