summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-09 15:36:13 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-09 15:36:13 +0000
commit14c504b3cc974e31fd0cdca8bfb654ddba4906be (patch)
treee97ae640dc5b319770572e85e8579bed50ea9473 /rational.c
parent5aee85cef11daf8ad7f4f62ab3d4065875397cb0 (diff)
* complex.c (string_to_c_internal): uses rb_reg_nth_match;
* rational.c (string_to_r_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/rational.c b/rational.c
index b64d4dd..00d71bf 100644
--- a/rational.c
+++ b/rational.c
@@ -2018,12 +2018,6 @@ make_patterns(void)
#define id_match rb_intern("match")
#define f_match(x,y) rb_funcall((x), id_match, 1, (y))
-#define id_aref rb_intern("[]")
-#define f_aref(x,y) rb_funcall((x), id_aref, 1, (y))
-
-#define id_post_match rb_intern("post_match")
-#define f_post_match(x) rb_funcall((x), id_post_match, 0)
-
#define id_split rb_intern("split")
#define f_split(x,y) rb_funcall((x), id_split, 1, (y))
@@ -2043,10 +2037,10 @@ string_to_r_internal(VALUE self)
if (!NIL_P(m)) {
VALUE v, ifp, exp, ip, fp;
- VALUE si = f_aref(m, INT2FIX(1));
- VALUE nu = f_aref(m, INT2FIX(2));
- VALUE de = f_aref(m, INT2FIX(3));
- VALUE re = f_post_match(m);
+ VALUE si = rb_reg_nth_match(1, m);
+ VALUE nu = rb_reg_nth_match(2, m);
+ VALUE de = rb_reg_nth_match(3, m);
+ VALUE re = rb_reg_match_post(m);
{
VALUE a;