* re.c (match_aref): remove useless condition and call rb_fix2int.
rb_reg_nth_match handles negative index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
92f8d74a3e
commit
e6a10e89b1
@ -1,3 +1,8 @@
|
||||
Wed May 18 02:02:58 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* re.c (match_aref): remove useless condition and call rb_fix2int.
|
||||
rb_reg_nth_match handles negative index.
|
||||
|
||||
Wed May 18 01:57:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* re.c (match_values_at): MatchData#values_at supports named captures
|
||||
|
4
re.c
4
re.c
@ -1888,9 +1888,7 @@ match_aref(int argc, VALUE *argv, VALUE match)
|
||||
|
||||
if (NIL_P(rest)) {
|
||||
if (FIXNUM_P(idx)) {
|
||||
if (FIX2INT(idx) >= 0) {
|
||||
return rb_reg_nth_match(FIX2INT(idx), match);
|
||||
}
|
||||
return rb_reg_nth_match(FIX2INT(idx), match);
|
||||
}
|
||||
else {
|
||||
int num = namev_to_backref_number(RMATCH_REGS(match), RMATCH(match)->regexp, idx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user