diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-12 14:30:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-12 14:30:32 +0000 |
commit | b1f618e9e511ee9fd16cb86153a48193652472db (patch) | |
tree | 807adf63d2a7bfa4a54872b60ec2707dc3f04ffa /object.c | |
parent | 898bb1cbe3391dd69093edbbc00f2f164c8457b6 (diff) | |
download | ruby-b1f618e9e511ee9fd16cb86153a48193652472db.tar.gz |
* object.c (rb_to_integer, rb_check_to_integer): return Bignum
as-is.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2057,6 +2057,7 @@ rb_to_integer(VALUE val, const char *method) VALUE v; if (FIXNUM_P(val)) return val; + if (TYPE(val) == T_BIGNUM) return val; v = convert_type(val, "Integer", method, Qtrue); if (!rb_obj_is_kind_of(v, rb_cInteger)) { const char *cname = rb_obj_classname(val); @@ -2072,6 +2073,7 @@ rb_check_to_integer(VALUE val, const char *method) VALUE v; if (FIXNUM_P(val)) return val; + if (TYPE(val) == T_BIGNUM) return val; v = convert_type(val, "Integer", method, Qfalse); if (!rb_obj_is_kind_of(v, rb_cInteger)) { return Qnil; |