summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/string.c b/src/string.c
index b68b533f3..6e5f91e3d 100644
--- a/src/string.c
+++ b/src/string.c
@@ -741,12 +741,10 @@ num_index:
/* check if indx is Range */
{
mrb_int beg, len;
- mrb_value tmp;
len = RSTRING_LEN(str);
if (mrb_range_beg_len(mrb, indx, &beg, &len, len)) {
- tmp = mrb_str_subseq(mrb, str, beg, len);
- return tmp;
+ return mrb_str_subseq(mrb, str, beg, len);
}
else {
return mrb_nil_value();