mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
aed254f314
commit
8a3856dc1e
1 changed files with 6 additions and 4 deletions
10
enum.c
10
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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue