Remove unneeded mrb_str_dup() in Module#name

`mrb_class_path()` always returns a new string or `nil`.
This commit is contained in:
KOBAYASHI Shuji
2019-06-17 21:46:30 +09:00
parent 1685c459dd
commit faec8331b7
+1 -2
View File
@@ -5,8 +5,7 @@
static mrb_value
mrb_mod_name(mrb_state *mrb, mrb_value self)
{
mrb_value name = mrb_class_path(mrb, mrb_class_ptr(self));
return mrb_nil_p(name)? name : mrb_str_dup(mrb, name);
return mrb_class_path(mrb, mrb_class_ptr(self));
}
static mrb_value