From f6f388a5bdbd3d3a68bf18f3352ba2be12688639 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 2 Dec 2012 09:57:47 +0000 Subject: * array.c, enum.c, insns.def, io.c, numeric.c, parse.y, process.c, range.c: use prepared IDs. A patch from charliesome (Charlie Somerville). [Bug #7495] * common.mk: add dependency to id.h. * common.mk: replace ID_H_INCLUDES with id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- range.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'range.c') diff --git a/range.c b/range.c index 443ee6e..43c3389 100644 --- a/range.c +++ b/range.c @@ -12,6 +12,7 @@ #include "ruby/ruby.h" #include "ruby/encoding.h" #include "internal.h" +#include "id.h" #ifdef HAVE_FLOAT_H #include @@ -88,7 +89,7 @@ range_initialize(int argc, VALUE *argv, VALUE range) rb_scan_args(argc, argv, "21", &beg, &end, &flags); /* Ranges are immutable, so that they should be initialized only once. */ if (RANGE_EXCL(range) != Qnil) { - rb_name_error(rb_intern("initialize"), "`initialize' called twice"); + rb_name_error(idInitialize, "`initialize' called twice"); } range_init(range, beg, end, RTEST(flags)); return Qnil; @@ -432,7 +433,7 @@ range_step(int argc, VALUE *argv, VALUE range) else if (rb_obj_is_kind_of(b, rb_cNumeric) || !NIL_P(rb_check_to_integer(b, "to_int")) || !NIL_P(rb_check_to_integer(e, "to_int"))) { - ID op = EXCL(range) ? '<' : rb_intern("<="); + ID op = EXCL(range) ? '<' : idLE; VALUE v = b; int i = 0; @@ -924,7 +925,7 @@ range_first(int argc, VALUE *argv, VALUE range) rb_scan_args(argc, argv, "1", &n); ary[0] = n; ary[1] = rb_ary_new2(NUM2LONG(n)); - rb_block_call(range, rb_intern("each"), 0, 0, first_i, (VALUE)ary); + rb_block_call(range, idEach, 0, 0, first_i, (VALUE)ary); return ary[1]; } -- cgit v1.1