summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-25 07:11:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-25 07:11:45 +0000
commitf94ed2ce4bcf201a4d16a85f0fdbbfce4ea20e35 (patch)
tree677fb2acdfd527d0d16f2b160c1a1856a8a6f157 /vm_eval.c
parentf9c2adf3109a8e0a1ae5c4125e695cc9d1f9722d (diff)
error.c: remove singleton method
* error.c (rb_name_err_mesg_new): remove singleton method, and unused argument. * vm_eval.c (make_no_method_exception): call rb_name_err_mesg_new directly instead of constant lookup and method invocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/vm_eval.c b/vm_eval.c
index fd2277f..bbc7666 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -668,19 +668,12 @@ static VALUE
make_no_method_exception(VALUE exc, const char *format, VALUE obj, int argc, const VALUE *argv)
{
int n = 0;
- VALUE mesg;
VALUE args[3];
if (!format) {
format = "undefined method `%s' for %s";
}
- mesg = rb_const_get(exc, rb_intern("message"));
- if (rb_method_basic_definition_p(CLASS_OF(mesg), '!')) {
- args[n++] = rb_name_err_mesg_new(mesg, rb_str_new2(format), obj, argv[0]);
- }
- else {
- args[n++] = rb_funcall(mesg, '!', 3, rb_str_new2(format), obj, argv[0]);
- }
+ args[n++] = rb_name_err_mesg_new(rb_str_new_cstr(format), obj, argv[0]);
args[n++] = argv[0];
if (exc == rb_eNoMethodError) {
args[n++] = rb_ary_new4(argc - 1, argv + 1);