summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 12:37:20 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 12:37:20 (GMT)
commit4ca0483a2879d6db9174d26f62ea98de33058650 (patch)
tree378e316fe28c3f5abd268a7fecf90729cfe56fe2 /array.c
parent90ab5beb42a226a92d31a1da5cf9d99d276e05e6 (diff)
* array.c (rb_ary_max, rb_ary_min): implement Array#max and min with
arguments. replace super call with rb_nmin_run. * enum.c (nmin_run): exported (as rb_nmin_run). * internal.h: added a prototype for rb_nmin_run. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index 75dbcd4..635baa4 100644
--- a/array.c
+++ b/array.c
@@ -4211,7 +4211,7 @@ rb_ary_max(int argc, VALUE *argv, VALUE ary)
rb_scan_args(argc, argv, "01", &num);
if (!NIL_P(num))
- return rb_call_super(argc, argv); /* XXX: should redefine? */
+ return rb_nmin_run(ary, num, 0, 1, 1);
if (rb_block_given_p()) {
for (i = 0; i < RARRAY_LEN(ary); i++) {
@@ -4266,7 +4266,7 @@ rb_ary_min(int argc, VALUE *argv, VALUE ary)
rb_scan_args(argc, argv, "01", &num);
if (!NIL_P(num))
- return rb_call_super(argc, argv); /* XXX: should redefine? */
+ return rb_nmin_run(ary, num, 0, 0, 1);
if (rb_block_given_p()) {
for (i = 0; i < RARRAY_LEN(ary); i++) {