* enum.c (all_iter_i, any_iter_i): reduced duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
93df43f8ae
commit
8481c848da
@ -1,3 +1,7 @@
|
||||
Sun May 11 23:19:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enum.c (all_iter_i, any_iter_i): reduced duplicated code.
|
||||
|
||||
Sun May 11 22:54:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* bootstraptest/runner.rb (main): leave -I options for purelib.rb
|
||||
|
32
enum.c
32
enum.c
@ -761,16 +761,6 @@ enum_sort_by(VALUE obj)
|
||||
return ary;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
all_iter_i(VALUE i, VALUE *memo)
|
||||
{
|
||||
if (!RTEST(rb_yield(i))) {
|
||||
*memo = Qfalse;
|
||||
rb_iter_break();
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
all_i(VALUE i, VALUE *memo)
|
||||
{
|
||||
@ -781,6 +771,12 @@ all_i(VALUE i, VALUE *memo)
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
all_iter_i(VALUE i, VALUE *memo)
|
||||
{
|
||||
return all_i(rb_yield(i), memo);
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* enum.all? [{|obj| block } ] => true or false
|
||||
@ -807,16 +803,6 @@ enum_all(VALUE obj)
|
||||
return result;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
any_iter_i(VALUE i, VALUE *memo)
|
||||
{
|
||||
if (RTEST(rb_yield(i))) {
|
||||
*memo = Qtrue;
|
||||
rb_iter_break();
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
any_i(VALUE i, VALUE *memo)
|
||||
{
|
||||
@ -827,6 +813,12 @@ any_i(VALUE i, VALUE *memo)
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
any_iter_i(VALUE i, VALUE *memo)
|
||||
{
|
||||
return any_i(rb_yield(i), memo);
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* enum.any? [{|obj| block } ] => true or false
|
||||
|
Loading…
x
Reference in New Issue
Block a user