diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-17 14:04:22 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-17 14:04:22 +0000 |
commit | 52c7bbd44460bc8e0c1142204c6740782c36c45e (patch) | |
tree | 163775066b22502d9f5a26b5d72ebd170f29a988 /ext | |
parent | 4e8d6c105c22c40f1abf1aab357419e8f4ef2f5b (diff) | |
download | ruby-52c7bbd44460bc8e0c1142204c6740782c36c45e.tar.gz |
* ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
remove duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 151a68cea6..86070af3cb 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -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)); } |