Bug #455

Array#sample(n) loops if a > arr.size

Added by Dave Thomas almost 7 years ago. Updated about 4 years ago.

[ruby-core:18337]
Status:Closed
Priority:Normal
Assignee:-
ruby -v: Backport:

Description

=begin
Try:

[1].sample(2)
=end

Associated revisions

Revision 18718
Added by Nobuyoshi Nakada almost 7 years ago

  • array.c (rb_ary_sample): get rid of infinite loop. #455

Revision 18718
Added by Nobuyoshi Nakada almost 7 years ago

  • array.c (rb_ary_sample): get rid of infinite loop. #455

History

#1 Updated by Nobuyoshi Nakada almost 7 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r18718.
=end

Also available in: Atom PDF