Project

General

Profile

Bug #455

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

Added by pragdave (Dave Thomas) almost 11 years ago. Updated about 8 years ago.

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

Description

=begin
Try:

[1].sample(2)
=end

Associated revisions

Revision 6523eee8
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 18718
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

Revision 18718
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

Revision 18718
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

Revision 18718
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

Revision 18718
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

Revision 18718
Added by nobu (Nobuyoshi Nakada) almost 11 years ago

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

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 11 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