Use rb_reg_nth_defined instead of rb_match_nth_defined

This commit is contained in:
Nobuyoshi Nakada 2023-06-27 22:39:15 +09:00
parent eaad44adb2
commit df5ae0a550
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
Notes: git 2023-06-27 15:27:56 +00:00
4 changed files with 1 additions and 24 deletions

17
re.c
View file

@ -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)
{