[前][次][番号順一覧][スレッド一覧]

ruby-changes:30298

From: nobu <ko1@a...>
Date: Sat, 3 Aug 2013 10:34:55 +0900 (JST)
Subject: [ruby-changes:30298] nobu:r42350 (trunk): parse.y: no reduction with 1

nobu	2013-08-03 10:33:58 +0900 (Sat, 03 Aug 2013)

  New Revision: 42350

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42350

  Log:
    parse.y: no reduction with 1
    
    * parse.y (parser_set_integer_literal): use rb_rational_raw1() for
      integral rational because no reduction is needed with 1.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42349)
+++ ChangeLog	(revision 42350)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug  3 10:33:52 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (parser_set_integer_literal): use rb_rational_raw1() for
+	  integral rational because no reduction is needed with 1.
+
 Sat Aug  3 09:46:07 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
Index: parse.y
===================================================================
--- parse.y	(revision 42349)
+++ parse.y	(revision 42350)
@@ -6428,7 +6428,7 @@ parser_set_integer_literal(struct parser https://github.com/ruby/ruby/blob/trunk/parse.y#L6428
 {
     int type = tINTEGER;
     if (suffix & NUM_SUFFIX_R) {
-	v = rb_rational_new(v, INT2FIX(1));
+	v = rb_rational_raw1(v);
 	type = tRATIONAL;
     }
     return set_number_literal(v, type, suffix);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]