mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
move range aware aget to array.c from mruby-array-ext gem
This commit is contained in:
+1
-3
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user