aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2022-11-15 13:24:08 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-16 18:58:33 +0900
commit1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6 (patch)
tree823f1ca5409fdd930b05d974cdb70953b6e7e128 /re.c
parentdc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff)
downloadruby-1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6.tar.gz
Using UNDEF_P macro
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/re.c b/re.c
index 1b83148321..15fe10b6af 100644
--- a/re.c
+++ b/re.c
@@ -3832,14 +3832,14 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
str = RREGEXP_SRC(re);
}
else {
- if (opts != Qundef) {
+ if (!UNDEF_P(opts)) {
int f;
if (FIXNUM_P(opts)) flags = FIX2INT(opts);
else if ((f = str_to_option(opts)) >= 0) flags = f;
else if (!NIL_P(opts) && rb_bool_expected(opts, "ignorecase", FALSE))
flags = ONIG_OPTION_IGNORECASE;
}
- if (n_flag != Qundef && !NIL_P(n_flag)) {
+ if (!UNDEF_P(n_flag) && !NIL_P(n_flag)) {
char *kcode = StringValuePtr(n_flag);
if (kcode[0] == 'n' || kcode[0] == 'N') {
enc = rb_ascii8bit_encoding();