summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/enum.c b/enum.c
index dc7e2112a4..05194c1f52 100644
--- a/enum.c
+++ b/enum.c
@@ -153,18 +153,6 @@ collect_i(i, tmp)
}
static VALUE
-enum_collect(obj)
- VALUE obj;
-{
- VALUE tmp;
-
- tmp = rb_ary_new();
- rb_iterate(rb_each, obj, collect_i, tmp);
-
- return tmp;
-}
-
-static VALUE
enum_all(i, ary)
VALUE i, ary;
{
@@ -185,6 +173,18 @@ enum_to_a(obj)
}
static VALUE
+enum_collect(obj)
+ VALUE obj;
+{
+ VALUE tmp;
+
+ tmp = rb_ary_new();
+ rb_iterate(rb_each, obj, rb_iterator_p() ? collect_i : enum_all, tmp);
+
+ return tmp;
+}
+
+static VALUE
enum_sort(obj)
VALUE obj;
{