зеркало из https://github.com/github/ruby.git
* enum.c (enum_minmax): fix SEGV by [].minmax.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3f2fe37200
Коммит
1fb587ddec
|
@ -1,3 +1,7 @@
|
|||
Sun Jun 24 03:05:00 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* enum.c (enum_minmax): fix SEGV by [].minmax.
|
||||
|
||||
Sat Jun 23 17:18:19 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* re.c (match_inspect): MatchData#inspect implemented.
|
||||
|
|
7
enum.c
7
enum.c
|
@ -1126,8 +1126,10 @@ enum_minmax(VALUE obj)
|
|||
else {
|
||||
rb_block_call(obj, id_each, 0, 0, minmax_i, (VALUE)result);
|
||||
}
|
||||
RARRAY_PTR(ary)[0] = result[0];
|
||||
RARRAY_PTR(ary)[1] = result[1];
|
||||
if (result[0] != Qundef) {
|
||||
RARRAY_PTR(ary)[0] = result[0];
|
||||
RARRAY_PTR(ary)[1] = result[1];
|
||||
}
|
||||
return ary;
|
||||
}
|
||||
|
||||
|
@ -1563,6 +1565,7 @@ Init_Enumerable(void)
|
|||
rb_define_method(rb_mEnumerable,"max", enum_max, 0);
|
||||
rb_define_method(rb_mEnumerable,"minmax", enum_minmax, 0);
|
||||
rb_define_method(rb_mEnumerable,"min_by", enum_min_by, 0);
|
||||
rb_define_method(rb_mEnumerable,"max_by", enum_max_by, 0);
|
||||
rb_define_method(rb_mEnumerable,"minmax_by", enum_minmax_by, 0);
|
||||
rb_define_method(rb_mEnumerable,"member?", enum_member, 1);
|
||||
rb_define_method(rb_mEnumerable,"include?", enum_member, 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче