From a871e4908f3359231305211f328b76eb2399b57f Mon Sep 17 00:00:00 2001 From: Aurora Nockert Date: Sat, 13 Jul 2024 15:38:14 +0200 Subject: [PATCH] Minor cleanup in mrb_str_init mrb_str_new was essentially manually inlined here, and I think it is a bit easier to follow if we just call the function instead. --- src/string.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/string.c b/src/string.c index 4c165144f..c9565f8e9 100644 --- a/src/string.c +++ b/src/string.c @@ -1982,8 +1982,7 @@ mrb_str_init(mrb_state *mrb, mrb_value self) mrb_value str2; if (mrb_get_args(mrb, "|S", &str2) == 0) { - struct RString *s = str_new(mrb, 0, 0); - str2 = mrb_obj_value(s); + str2 = mrb_str_new(mrb, 0, 0); } str_replace(mrb, mrb_str_ptr(self), mrb_str_ptr(str2)); return self;