diff options
author | S.H <gamelinks007@gmail.com> | 2021-10-03 22:34:45 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-03 22:34:45 +0900 |
commit | dc9112cf10e63b5272e9469d080d5d1ced30276e (patch) | |
tree | 2970b172b25b303dd839fced592564a77eedeab1 /re.c | |
parent | fb03598666ddbb9f8b35eb4f599e75654ca7ca06 (diff) |
Using NIL_P macro instead of `== Qnil`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4925
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) { |