summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-24 01:16:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-24 01:16:36 +0000
commit8a3856dc1ee0f0a9105592de9b29507eba1a8dda (patch)
treeef501655f60c5c0c1642a68ab016edd8868d483b /enum.c
parentaed254f314b9c2bdae46d34dd17300cadace3907 (diff)
enum.c: id_call
* enum.c (id_call): intern first and share. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/enum.c b/enum.c
index 0e4cf33..5801c94 100644
--- a/enum.c
+++ b/enum.c
@@ -19,6 +19,7 @@
VALUE rb_mEnumerable;
static ID id_next;
+static ID id_call;
#define id_each idEach
#define id_eqq idEqq
#define id_cmp idCmp
@@ -2264,9 +2265,9 @@ chunk_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
ENUM_WANT_SVALUE();
if (NIL_P(argp->state))
- v = rb_funcall(argp->categorize, rb_intern("call"), 1, i);
+ v = rb_funcall(argp->categorize, id_call, 1, i);
else
- v = rb_funcall(argp->categorize, rb_intern("call"), 2, i, argp->state);
+ v = rb_funcall(argp->categorize, id_call, 2, i, argp->state);
if (v == alone) {
if (!NIL_P(argp->prev_value)) {
@@ -2462,9 +2463,9 @@ slicebefore_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
if (!NIL_P(argp->sep_pat))
header_p = rb_funcall(argp->sep_pat, id_eqq, 1, i);
else if (NIL_P(argp->state))
- header_p = rb_funcall(argp->sep_pred, rb_intern("call"), 1, i);
+ header_p = rb_funcall(argp->sep_pred, id_call, 1, i);
else
- header_p = rb_funcall(argp->sep_pred, rb_intern("call"), 2, i, argp->state);
+ header_p = rb_funcall(argp->sep_pred, id_call, 2, i, argp->state);
if (RTEST(header_p)) {
if (!NIL_P(argp->prev_elts))
rb_funcall(argp->yielder, id_lshift, 1, argp->prev_elts);
@@ -2733,4 +2734,5 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "slice_before", enum_slice_before, -1);
id_next = rb_intern("next");
+ id_call = rb_intern("call");
}