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:
parent
69509df2f4
commit
02b1a85385
2 changed files with 2 additions and 2 deletions
2
error.c
2
error.c
|
@ -1098,7 +1098,7 @@ exc_inspect(VALUE exc)
|
||||||
klass = CLASS_OF(exc);
|
klass = CLASS_OF(exc);
|
||||||
exc = rb_obj_as_string(exc);
|
exc = rb_obj_as_string(exc);
|
||||||
if (RSTRING_LEN(exc) == 0) {
|
if (RSTRING_LEN(exc) == 0) {
|
||||||
return rb_str_dup(rb_class_name(klass));
|
return rb_class_name(klass);
|
||||||
}
|
}
|
||||||
|
|
||||||
str = rb_str_buf_new2("#<");
|
str = rb_str_buf_new2("#<");
|
||||||
|
|
2
object.c
2
object.c
|
@ -1800,7 +1800,7 @@ rb_mod_to_s(VALUE klass)
|
||||||
rb_str_cat2(s, ">");
|
rb_str_cat2(s, ">");
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
return rb_str_dup(rb_class_name(klass));
|
return rb_class_name(klass);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue