ruby-changes:15459
From: mame <ko1@a...>
Date: Fri, 16 Apr 2010 21:36:58 +0900 (JST)
Subject: [ruby-changes:15459] Ruby:r27358 (trunk): * ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): revert r23389,
mame 2010-04-16 21:36:41 +0900 (Fri, 16 Apr 2010) New Revision: 27358 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27358 Log: * 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] Modified files: trunk/ChangeLog trunk/ext/bigdecimal/bigdecimal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 27357) +++ ChangeLog (revision 27358) @@ -1,3 +1,9 @@ +Fri Apr 16 21:27:57 2010 Yusuke Endoh <mame@t...> + + * 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] + Fri Apr 16 20:05:24 2010 Yusuke Endoh <mame@t...> * lib/thread.rb (Queue#push, #pop, SizedQueue#push, #pop): remove Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 27357) +++ ext/bigdecimal/bigdecimal.c (revision 27358) @@ -602,14 +602,9 @@ 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/