diff options
author | S-H-GAMELINKS <[email protected]> | 2022-11-15 13:24:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-11-16 18:58:33 +0900 |
commit | 1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6 (patch) | |
tree | 823f1ca5409fdd930b05d974cdb70953b6e7e128 /string.c | |
parent | dc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff) |
Using UNDEF_P macro
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6721
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)) { |