зеркало из https://github.com/github/ruby.git
* array.c (rb_ary_shuffle_bang, rb_ary_sample): rename local variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3e1360f370
Коммит
7f5a9f3881
|
@ -1,3 +1,7 @@
|
|||
Sun Dec 8 14:55:12 2013 Kazuki Tsujimoto <kazuki@callcc.net>
|
||||
|
||||
* array.c (rb_ary_shuffle_bang, rb_ary_sample): rename local variables.
|
||||
|
||||
Sun Dec 8 13:59:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
|
||||
|
||||
* array.c (rb_ary_shuffle_bang, rb_ary_sample): check
|
||||
|
|
16
array.c
16
array.c
|
@ -4438,10 +4438,10 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
|
|||
}
|
||||
|
||||
if (OPTHASH_GIVEN_P(opts)) {
|
||||
VALUE random;
|
||||
rb_get_kwargs(opts, keyword_ids, 0, 1, &random);
|
||||
if (random != Qundef) {
|
||||
randgen = random;
|
||||
VALUE rnd;
|
||||
rb_get_kwargs(opts, keyword_ids, 0, 1, &rnd);
|
||||
if (rnd != Qundef) {
|
||||
randgen = rnd;
|
||||
}
|
||||
}
|
||||
rb_check_arity(argc, 0, 0);
|
||||
|
@ -4525,10 +4525,10 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
|
|||
}
|
||||
|
||||
if (OPTHASH_GIVEN_P(opts)) {
|
||||
VALUE random;
|
||||
rb_get_kwargs(opts, keyword_ids, 0, 1, &random);
|
||||
if (random != Qundef) {
|
||||
randgen = random;
|
||||
VALUE rnd;
|
||||
rb_get_kwargs(opts, keyword_ids, 0, 1, &rnd);
|
||||
if (rnd != Qundef) {
|
||||
randgen = rnd;
|
||||
}
|
||||
}
|
||||
len = RARRAY_LEN(ary);
|
||||
|
|
Загрузка…
Ссылка в новой задаче