1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
mame 2010-04-16 12:36:41 +00:00
parent 6511fec7ad
commit 49884b5769
2 changed files with 8 additions and 7 deletions

View file

@ -1,3 +1,9 @@
Fri Apr 16 21:27:57 2010 Yusuke Endoh <mame@tsg.ne.jp>
* 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@tsg.ne.jp> Fri Apr 16 20:05:24 2010 Yusuke Endoh <mame@tsg.ne.jp>
* lib/thread.rb (Queue#push, #pop, SizedQueue#push, #pop): remove * lib/thread.rb (Queue#push, #pop, SizedQueue#push, #pop): remove

View file

@ -602,14 +602,9 @@ BigDecimal_coerce(VALUE self, VALUE other)
ENTER(2); ENTER(2);
VALUE obj; VALUE obj;
Real *b; Real *b;
switch (TYPE(other)) { if (TYPE(other) == T_FLOAT) {
case T_FLOAT:
obj = rb_assoc_new(other, BigDecimal_to_f(self)); obj = rb_assoc_new(other, BigDecimal_to_f(self));
break; } else {
case T_RATIONAL:
obj = rb_assoc_new(other, BigDecimal_to_r(self));
break;
default:
GUARD_OBJ(b,GetVpValue(other,1)); GUARD_OBJ(b,GetVpValue(other,1));
obj = rb_assoc_new(b->obj, self); obj = rb_assoc_new(b->obj, self);
} }