From 3c01766dc978858627cd1fd46c991fa93165667b Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Sat, 1 Jul 2017 17:35:52 +0900 Subject: re.c: RMATCH_REGS(x) is never NULL --- re.c | 6 +----- 1 file changed, 1 insertion(+), 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; } -- cgit v1.2.3