aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--re.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/re.c b/re.c
index d0aa2a792e..2ac1778fd3 100644
--- a/re.c
+++ b/re.c
@@ -1265,11 +1265,8 @@ rb_match_busy(VALUE match)
int
rb_match_count(VALUE match)
{
- struct re_registers *regs;
if (NIL_P(match)) return -1;
- regs = RMATCH_REGS(match);
- if (!regs) return -1;
- return regs->num_regs;
+ return RMATCH_REGS(match)->num_regs;
}
int
@@ -1278,7 +1275,6 @@ 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;
}