Project

General

Profile

Bug #455

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

Added by Dave Thomas almost 8 years ago. Updated about 5 years ago.

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

Description

=begin
Try:

[1].sample(2)
=end

Associated revisions

Revision 18718
Added by Nobuyoshi Nakada almost 8 years ago

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

Revision 18718
Added by Nobuyoshi Nakada almost 8 years ago

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

Revision 18718
Added by Nobuyoshi Nakada almost 8 years ago

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

History

#1 Updated by Nobuyoshi Nakada almost 8 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