diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-29 14:53:38 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-29 14:53:38 +0900 |
| commit | 5346bdd76b3946a94efaea96ef10cbdbc5f8251e (patch) | |
| tree | 7abfd66be0f9b4f12b6f896d99cb3041e82175dc /src/string.c | |
| parent | b69bb896fcae64373606172fc43c558f02d4207f (diff) | |
| download | mruby-5346bdd76b3946a94efaea96ef10cbdbc5f8251e.tar.gz mruby-5346bdd76b3946a94efaea96ef10cbdbc5f8251e.zip | |
move range aware aget to array.c from mruby-array-ext gem
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 4 |
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(); |
