summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-24 04:34:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-24 04:34:26 +0000
commit8b1de0b1ad49733abeddd8be359ae816b29de59a (patch)
treea7ed03dd3f6442635f694c4367bcd94be57f6dbd /enum.c
parent24b9bdca25dc431aff935df7739b9c5ea0ee4077 (diff)
2000-05-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/enum.c b/enum.c
index 3eec1fd..4a97811 100644
--- a/enum.c
+++ b/enum.c
@@ -50,7 +50,7 @@ enum_grep(obj, pat)
VALUE tmp, arg[2];
arg[0] = pat; arg[1] = tmp = rb_ary_new();
- if (rb_iterator_p()) {
+ if (rb_block_given_p()) {
rb_iterate(rb_each, obj, grep_iter_i, (VALUE)arg);
}
else {
@@ -173,7 +173,7 @@ enum_collect(obj)
VALUE tmp;
tmp = rb_ary_new();
- rb_iterate(rb_each, obj, rb_iterator_p() ? collect_i : enum_all, tmp);
+ rb_iterate(rb_each, obj, rb_block_given_p() ? collect_i : enum_all, tmp);
return tmp;
}
@@ -225,7 +225,7 @@ enum_min(obj)
{
NODE *memo = rb_node_newnode(NODE_MEMO, Qnil, 0, 0);
- rb_iterate(rb_each, obj, rb_iterator_p()?min_ii:min_i, (VALUE)memo);
+ rb_iterate(rb_each, obj, rb_block_given_p()?min_ii:min_i, (VALUE)memo);
rb_gc_force_recycle((VALUE)memo);
return memo->u1.value;
}
@@ -270,7 +270,7 @@ enum_max(obj)
{
NODE *memo = rb_node_newnode(NODE_MEMO, Qnil, 0, 0);
- rb_iterate(rb_each, obj, rb_iterator_p()?max_ii:max_i, (VALUE)memo);
+ rb_iterate(rb_each, obj, rb_block_given_p()?max_ii:max_i, (VALUE)memo);
rb_gc_force_recycle((VALUE)memo);
return memo->u1.value;
}