summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 07:40:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 07:40:46 +0000
commit52817c3654518c55de31666848f08d7ac58f8787 (patch)
tree62892ab98f8b492e241afde8b8371b8d81c09583 /enum.c
parent9e0a2170fd9ae9ee3a7545630a685a4a3e2f795a (diff)
* lib/cgi.rb (CGI::out): specify -x option for nkf.
* lib/cgi.rb (CGI::out): should not convert utf-8 implicitly using NKF. it is too Japanese centric. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index 419a2b98e4..919c53b482 100644
--- a/enum.c
+++ b/enum.c
@@ -1187,6 +1187,27 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
return result;
}
+static VALUE
+in_i(VALUE i, VALUE *memo)
+{
+ if (rb_equal(i, memo[0])) {
+ memo[1] = Qtrue;
+ rb_iter_break();
+ }
+ return Qnil;
+}
+
+VALUE
+rb_enum_in(VALUE elem, VALUE obj)
+{
+ VALUE memo[2];
+
+ memo[0] = elem;
+ memo[1] = Qfalse;
+ rb_block_call(obj, id_each, 0, 0, in_i, (VALUE)&memo);
+ return memo[1];
+}
+
/*
* The <code>Enumerable</code> mixin provides collection classes with
* several traversal and searching methods, and with the ability to