diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-01 23:04:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-01 23:04:46 +0000 |
commit | 748787338a17a6b4046baef47c2244cd1672bd93 (patch) | |
tree | f4e7cb8c3edb5ff65540f088184c273fdb67f91f /time.c | |
parent | c257fc3d97fe98e028ad8783f0e26f5fb56a2c35 (diff) | |
download | ruby-748787338a17a6b4046baef47c2244cd1672bd93.tar.gz ruby-748787338a17a6b4046baef47c2244cd1672bd93.tar.xz ruby-748787338a17a6b4046baef47c2244cd1672bd93.zip |
* time.c (num_exact): rb_check_to_integer() can deal with both of
Fixnum and Bignum together.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -160,14 +160,11 @@ num_exact(VALUE v) case T_NIL: goto typeerror; - default: - { + default: { VALUE tmp; if (!NIL_P(tmp = rb_check_convert_type(v, T_RATIONAL, "Rational", "to_r"))) v = tmp; - else if (!NIL_P(tmp = rb_check_convert_type(v, T_FIXNUM, "Integer", "to_int"))) - v = tmp; - else if (!NIL_P(tmp = rb_check_convert_type(v, T_BIGNUM, "Integer", "to_int"))) + else if (!NIL_P(tmp = rb_check_to_integer(v, "to_int"))) v = tmp; else { typeerror: |