Project

General

Profile

Bug #455

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

Added by Dave Thomas over 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
ruby -v:
Backport:
2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
[ruby-core:18337]

Description

=begin
Try:

[1].sample(2)
=end

Associated revisions

Revision 18718
Added by Nobuyoshi Nakada over 7 years ago

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

Revision 18718
Added by Nobuyoshi Nakada over 7 years ago

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

History

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