From 02b1a85385e7fd18b8bcecfdbbf1acbac703c039 Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Mon, 10 Jun 2019 16:46:57 -0400 Subject: remove 2 redundant calls to rb_str_dup Because `rb_class_path` calls `rb_str_dup` already. Closes: https://github.com/ruby/ruby/pull/2232 --- error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'error.c') diff --git a/error.c b/error.c index 19265f65cb..ffe34afc11 100644 --- a/error.c +++ b/error.c @@ -1098,7 +1098,7 @@ exc_inspect(VALUE exc) klass = CLASS_OF(exc); exc = rb_obj_as_string(exc); if (RSTRING_LEN(exc) == 0) { - return rb_str_dup(rb_class_name(klass)); + return rb_class_name(klass); } str = rb_str_buf_new2("#<"); -- cgit v1.2.3