mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rational.c: optimize (-rational).rationalize(some)
* rational.c (nurat_rationalize): optimize (-rational).rationalize(some). Author: Tadashi Saito <tad.a.digger@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3364f711e
commit
edfa67c248
1 changed files with 2 additions and 2 deletions
|
@ -1616,8 +1616,8 @@ nurat_rationalize(int argc, VALUE *argv, VALUE self)
|
|||
if (argc == 0)
|
||||
return self;
|
||||
|
||||
if (f_negative_p(self))
|
||||
return f_negate(nurat_rationalize(argc, argv, f_abs(self)));
|
||||
if (nurat_negative_p(self))
|
||||
return nurat_negate(nurat_rationalize(argc, argv, nurat_negate(self)));
|
||||
|
||||
rb_scan_args(argc, argv, "01", &e);
|
||||
e = f_abs(e);
|
||||
|
|
Loading…
Reference in a new issue