From dc9112cf10e63b5272e9469d080d5d1ced30276e Mon Sep 17 00:00:00 2001 From: "S.H" Date: Sun, 3 Oct 2021 22:34:45 +0900 Subject: Using NIL_P macro instead of `== Qnil` --- re.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index 58e43f9c29..cccedc9869 100644 --- a/re.c +++ b/re.c @@ -1557,7 +1557,7 @@ rb_reg_prepare_re0(VALUE re, VALUE str, onig_errmsg_buffer err) pattern, pattern + RREGEXP_SRC_LEN(re), enc, &fixed_enc, err); - if (unescaped == Qnil) { + if (NIL_P(unescaped)) { rb_raise(rb_eArgError, "regexp preprocess failed: %s", err); } @@ -2357,7 +2357,7 @@ match_inspect(VALUE match) rb_str_buf_cat2(str, ":"); } v = rb_reg_nth_match(i, match); - if (v == Qnil) + if (NIL_P(v)) rb_str_buf_cat2(str, "nil"); else rb_str_buf_append(str, rb_str_inspect(v)); @@ -2800,7 +2800,7 @@ rb_reg_check_preprocess(VALUE str) buf = rb_reg_preprocess(p, end, enc, &fixed_enc, err); RB_GC_GUARD(str); - if (buf == Qnil) { + if (NIL_P(buf)) { return rb_reg_error_desc(str, 0, err); } return Qnil; @@ -2841,7 +2841,7 @@ rb_reg_preprocess_dregexp(VALUE ary, int options) buf = rb_reg_preprocess(p, end, src_enc, &fixed_enc, err); - if (buf == Qnil) + if (NIL_P(buf)) rb_raise(rb_eArgError, "%s", err); if (fixed_enc != 0) { @@ -2887,7 +2887,7 @@ rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc, } unescaped = rb_reg_preprocess(s, s+len, enc, &fixed_enc, err); - if (unescaped == Qnil) + if (NIL_P(unescaped)) return -1; if (fixed_enc) { -- cgit v1.2.3