aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-03 01:33:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-03 01:33:58 +0000
commit6660c5fb0cb9dc5aa430765c958cec5b4bda5e58 (patch)
tree61d8e07ea38adb4a2b8e7b5f900c2713877d3074
parent4c009414119347e87d9bb2402617a4585dd3f341 (diff)
downloadruby-6660c5fb0cb9dc5aa430765c958cec5b4bda5e58.tar.gz
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f9a3a55a47..d5063d4d54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Aug 3 10:33:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
diff --git a/parse.y b/parse.y
index c2f5cf04fc..f392be7bfa 100644
--- a/parse.y
+++ b/parse.y
@@ -6428,7 +6428,7 @@ parser_set_integer_literal(struct parser_params *parser, VALUE v, int suffix)
{
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);