Commit b9dc9ccd authored by Jun Hiroe's avatar Jun Hiroe

Refacotr mrb_str_substr()

parent 5921dd19
......@@ -1230,8 +1230,6 @@ mrb_str_subseq(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
mrb_value
mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
{
mrb_value str2;
if (len < 0) return mrb_nil_value();
if (!RSTRING_LEN(str)) {
len = 0;
......@@ -1246,9 +1244,7 @@ mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
if (len <= 0) {
len = 0;
}
str2 = mrb_str_subseq(mrb, str, beg, len);
return str2;
return mrb_str_subseq(mrb, str, beg, len);
}
mrb_int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment