mruby-print/print.rb: reduce explicit return values; ref #5762

By making __printstr__ to return nil.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-07-31 07:56:06 +09:00
parent a8e6b840ea
commit d28009ebd8
2 changed files with 1 additions and 3 deletions
-2
View File
@@ -47,11 +47,9 @@ module Kernel
i += 1
end
__printstr__ "\n" if len == 0
nil
end
def printf(*args)
__printstr__(sprintf(*args))
nil
end
end
+1 -1
View File
@@ -43,7 +43,7 @@ mrb_printstr(mrb_state *mrb, mrb_value self)
if (mrb_string_p(s)) {
printstr(mrb, RSTRING_PTR(s), RSTRING_LEN(s));
}
return s;
return mrb_nil_value();
}
void