diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-02 09:57:47 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-02 09:57:47 +0000 |
commit | f6f388a5bdbd3d3a68bf18f3352ba2be12688639 (patch) | |
tree | 3bdfb745e956666c70e078e9f3243a3a5b54c417 /range.c | |
parent | d64a73e1ddba8706617205dab4e640f5ce7191b0 (diff) | |
download | ruby-f6f388a5bdbd3d3a68bf18f3352ba2be12688639.tar.gz |
* 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
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -12,6 +12,7 @@ #include "ruby/ruby.h" #include "ruby/encoding.h" #include "internal.h" +#include "id.h" #ifdef HAVE_FLOAT_H #include <float.h> @@ -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]; } |