diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2017-07-01 17:35:52 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2017-07-05 07:11:31 +0000 |
commit | 3c01766dc978858627cd1fd46c991fa93165667b (patch) | |
tree | 633942937a9490948b7866cf5bde0688c7d36854 /re.c | |
parent | 38f8c5a39b9215961c4f7ff8d0833acdbddffc0d (diff) | |
download | ruby-rmatch-regs-is-never-null.tar.gz |
re.c: RMATCH_REGS(x) is never NULLrmatch-regs-is-never-null
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -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; } |