Skip to content

Commit

Permalink
* ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
Browse files Browse the repository at this point in the history
  remove duplication.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
mrkn committed Aug 17, 2011
1 parent 4e8d6c1 commit 52c7bbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Wed Aug 17 23:01:00 2011 Kenta Murata <[email protected]>

* ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
remove duplication.

Wed Aug 17 15:27:00 2011 Kenta Murata <[email protected]>

* ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
Expand Down
7 changes: 3 additions & 4 deletions ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@ cannot_be_coerced_into_BigDecimal(VALUE exc_class, VALUE v)
VALUE str;

if (rb_special_const_p(v)) {
str = rb_str_cat2(rb_str_dup(rb_inspect(v)),
" can't be coerced into BigDecimal");
str = rb_inspect(v);
}
else {
str = rb_str_cat2(rb_str_dup(rb_class_name(rb_obj_class(v))),
" can't be coerced into BigDecimal");
str = rb_class_name(rb_obj_class(v));
}

str = rb_str_cat2(rb_str_dup(str), " can't be coerced into BigDecimal");
rb_exc_raise(rb_exc_new3(exc_class, str));
}

Expand Down

0 comments on commit 52c7bbd

Please sign in to comment.