* array.c (rb_ary_combination): argument check before creating
Enumerator. * array.c (rb_ary_permutation): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
83c017d7af
commit
8f14847366
@ -1,3 +1,10 @@
|
|||||||
|
Tue Mar 11 23:38:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* array.c (rb_ary_combination): argument check before creating
|
||||||
|
Enumerator.
|
||||||
|
|
||||||
|
* array.c (rb_ary_permutation): ditto.
|
||||||
|
|
||||||
Tue Mar 11 19:48:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Mar 11 19:48:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* numeric.c (fix_coerce): try conversion before type check.
|
* numeric.c (fix_coerce): try conversion before type check.
|
||||||
|
4
array.c
4
array.c
@ -3030,8 +3030,8 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
|
|||||||
VALUE num;
|
VALUE num;
|
||||||
long r, n, i;
|
long r, n, i;
|
||||||
|
|
||||||
RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
|
|
||||||
n = RARRAY_LEN(ary); /* Array length */
|
n = RARRAY_LEN(ary); /* Array length */
|
||||||
|
RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
|
||||||
rb_scan_args(argc, argv, "01", &num);
|
rb_scan_args(argc, argv, "01", &num);
|
||||||
r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
|
r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
|
||||||
|
|
||||||
@ -3111,8 +3111,8 @@ rb_ary_combination(VALUE ary, VALUE num)
|
|||||||
{
|
{
|
||||||
long n, i, len;
|
long n, i, len;
|
||||||
|
|
||||||
RETURN_ENUMERATOR(ary, 1, &num);
|
|
||||||
n = NUM2LONG(num);
|
n = NUM2LONG(num);
|
||||||
|
RETURN_ENUMERATOR(ary, 1, &num);
|
||||||
len = RARRAY_LEN(ary);
|
len = RARRAY_LEN(ary);
|
||||||
if (n < 0 || len < n) {
|
if (n < 0 || len < n) {
|
||||||
/* yield nothing */
|
/* yield nothing */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#define RUBY_VERSION "1.9.0"
|
#define RUBY_VERSION "1.9.0"
|
||||||
#define RUBY_RELEASE_DATE "2008-03-11"
|
#define RUBY_RELEASE_DATE "2008-03-12"
|
||||||
#define RUBY_VERSION_CODE 190
|
#define RUBY_VERSION_CODE 190
|
||||||
#define RUBY_RELEASE_CODE 20080311
|
#define RUBY_RELEASE_CODE 20080312
|
||||||
#define RUBY_PATCHLEVEL 0
|
#define RUBY_PATCHLEVEL 0
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
@ -9,7 +9,7 @@
|
|||||||
#define RUBY_VERSION_TEENY 0
|
#define RUBY_VERSION_TEENY 0
|
||||||
#define RUBY_RELEASE_YEAR 2008
|
#define RUBY_RELEASE_YEAR 2008
|
||||||
#define RUBY_RELEASE_MONTH 3
|
#define RUBY_RELEASE_MONTH 3
|
||||||
#define RUBY_RELEASE_DAY 11
|
#define RUBY_RELEASE_DAY 12
|
||||||
|
|
||||||
#ifdef RUBY_EXTERN
|
#ifdef RUBY_EXTERN
|
||||||
RUBY_EXTERN const char ruby_version[];
|
RUBY_EXTERN const char ruby_version[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user