summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-06-27 22:39:15 +0900
committerNobuyoshi Nakada <[email protected]>2023-06-27 22:39:15 +0900
commitdf5ae0a55005f7f02adbf21790300f28dc2e12fc ()
tree3e89aa8f802e416b76056bdee163a08c7953cffe /re.c
parenteaad44adb2043f0b597196fd44cfaae8db3a3b18 (diff)
Use `rb_reg_nth_defined` instead of `rb_match_nth_defined`
Notes: Merged: https://.com/ruby/ruby/pull/7983
-rw-r--r--re.c17
1 files changed, 0 insertions, 17 deletions
@@ -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)
{