summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/string.c b/string.c
index 50da6dc621..0ae36e5c72 100644
--- a/string.c
+++ b/string.c
@@ -495,7 +495,7 @@ register_fstring(VALUE str, bool copy)
do {
args.fstr = str;
st_update(frozen_strings, (st_data_t)str, fstr_update_callback, (st_data_t)&args);
- } while (args.fstr == Qundef);
+ } while (UNDEF_P(args.fstr));
}
RB_VM_LOCK_LEAVE();
@@ -1873,10 +1873,10 @@ rb_str_init(int argc, VALUE *argv, VALUE str)
rb_get_kwargs(opt, keyword_ids, 0, 2, kwargs);
venc = kwargs[0];
vcapa = kwargs[1];
- if (venc != Qundef && !NIL_P(venc)) {
+ if (!UNDEF_P(venc) && !NIL_P(venc)) {
enc = rb_to_encoding(venc);
}
- if (vcapa != Qundef && !NIL_P(vcapa)) {
+ if (!UNDEF_P(vcapa) && !NIL_P(vcapa)) {
long capa = NUM2LONG(vcapa);
long len = 0;
int termlen = enc ? rb_enc_mbminlen(enc) : 1;
@@ -8922,7 +8922,7 @@ rb_str_enumerate_lines(int argc, VALUE *argv, VALUE str, VALUE ary)
keywords[0] = rb_intern_const("chomp");
}
rb_get_kwargs(opts, keywords, 0, 1, &chomp);
- chomp = (chomp != Qundef && RTEST(chomp));
+ chomp = (!UNDEF_P(chomp) && RTEST(chomp));
}
if (NIL_P(rs)) {