diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-16 12:36:41 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-16 12:36:41 +0000 |
commit | 49884b5769c4fa059e448d531fd759c37380e5c5 (patch) | |
tree | ae1261cc4adba08793618cba80983e32b053cd15 /ext/bigdecimal | |
parent | 6511fec7adc1f4604b46788d651f00c9d08aad8d (diff) | |
download | ruby-49884b5769c4fa059e448d531fd759c37380e5c5.tar.gz |
* ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): revert r23389,
which not only is unnecessary but also causes the inconsistency of
return type. [ruby-core:25706] [Bug #2129]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 9930e63944..2dd3213dca 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -602,14 +602,9 @@ BigDecimal_coerce(VALUE self, VALUE other) ENTER(2); VALUE obj; Real *b; - switch (TYPE(other)) { - case T_FLOAT: + if (TYPE(other) == T_FLOAT) { obj = rb_assoc_new(other, BigDecimal_to_f(self)); - break; - case T_RATIONAL: - obj = rb_assoc_new(other, BigDecimal_to_r(self)); - break; - default: + } else { GUARD_OBJ(b,GetVpValue(other,1)); obj = rb_assoc_new(b->obj, self); } |