summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorLuke Gruber <luke.gru@gmail.com>2019-06-10 16:46:57 -0400
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-13 18:05:04 +0900
commit02b1a85385e7fd18b8bcecfdbbf1acbac703c039 (patch)
tree52a0bacff518ae52574de612a5164146d70eceb5 /error.c
parent69509df2f4ed8e052d683fa3901c9f97d00ed7fc (diff)
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
Diffstat (limited to 'error.c')
-rw-r--r--error.c2
1 files changed, 1 insertions, 1 deletions
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("#<");