1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
Luke Gruber 2019-06-10 16:46:57 -04:00 committed by Nobuyoshi Nakada
parent 69509df2f4
commit 02b1a85385
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 2 additions and 2 deletions

View file

@ -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("#<");

View file

@ -1800,7 +1800,7 @@ rb_mod_to_s(VALUE klass)
rb_str_cat2(s, ">");
return s;
}
return rb_str_dup(rb_class_name(klass));
return rb_class_name(klass);
}
/*