зеркало из https://github.com/github/ruby.git
* array.c (rb_ary_choice): should return nil when the array is
empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2216212554
Коммит
aa77090aef
|
@ -1,3 +1,8 @@
|
|||
Mon May 14 01:54:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_choice): should return nil when the array is
|
||||
empty.
|
||||
|
||||
Sat May 12 18:26:36 2007 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* lib/net/http.rb (tokens): forgot to add strip. [ruby-core:11120]
|
||||
|
|
6
array.c
6
array.c
|
@ -2952,9 +2952,11 @@ rb_ary_shuffle(VALUE ary)
|
|||
static VALUE
|
||||
rb_ary_choice(VALUE ary)
|
||||
{
|
||||
long i = RARRAY_LEN(ary);
|
||||
long j = genrand_real()*i;
|
||||
long i, j;
|
||||
|
||||
i = RARRAY_LEN(ary);
|
||||
if (i == 0) return Qnil;
|
||||
j = genrand_real()*i;
|
||||
return RARRAY_PTR(ary)[j];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2007-05-12"
|
||||
#define RUBY_RELEASE_DATE "2007-05-14"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20070512
|
||||
#define RUBY_RELEASE_CODE 20070514
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2007
|
||||
#define RUBY_RELEASE_MONTH 5
|
||||
#define RUBY_RELEASE_DAY 12
|
||||
#define RUBY_RELEASE_DAY 14
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Загрузка…
Ссылка в новой задаче