mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Use rb_reg_nth_defined
instead of rb_match_nth_defined
This commit is contained in:
parent
eaad44adb2
commit
df5ae0a550
Notes:
git
2023-06-27 15:27:56 +00:00
4 changed files with 1 additions and 24 deletions
17
re.c
17
re.c
|
@ -1450,23 +1450,6 @@ rb_match_count(VALUE match)
|
|||
return regs->num_regs;
|
||||
}
|
||||
|
||||
int
|
||||
rb_match_nth_defined(int nth, VALUE match)
|
||||
{
|
||||
struct re_registers *regs;
|
||||
if (NIL_P(match)) return FALSE;
|
||||
regs = RMATCH_REGS(match);
|
||||
if (!regs) return FALSE;
|
||||
if (nth >= regs->num_regs) {
|
||||
return FALSE;
|
||||
}
|
||||
if (nth < 0) {
|
||||
nth += regs->num_regs;
|
||||
if (nth <= 0) return FALSE;
|
||||
}
|
||||
return (BEG(nth) != -1);
|
||||
}
|
||||
|
||||
static void
|
||||
match_set_string(VALUE m, VALUE string, long pos, long len)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue