diff options
author | S-H-GAMELINKS <gamelinks007@gmail.com> | 2022-11-15 13:24:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-16 18:58:33 +0900 |
commit | 1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6 (patch) | |
tree | 823f1ca5409fdd930b05d974cdb70953b6e7e128 /complex.c | |
parent | dc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff) | |
download | ruby-1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6.tar.gz |
Using UNDEF_P macro
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -561,7 +561,7 @@ nucomp_f_complex(int argc, VALUE *argv, VALUE klass) if (!NIL_P(opts)) { raise = rb_opts_exception_p(opts, raise); } - if (argc > 0 && CLASS_OF(a1) == rb_cComplex && a2 == Qundef) { + if (argc > 0 && CLASS_OF(a1) == rb_cComplex && UNDEF_P(a2)) { return a1; } return nucomp_convert(rb_cComplex, a1, a2, raise); @@ -2107,11 +2107,11 @@ nucomp_convert(VALUE klass, VALUE a1, VALUE a2, int raise) } if (RB_TYPE_P(a1, T_COMPLEX)) { - if (a2 == Qundef || (k_exact_zero_p(a2))) + if (UNDEF_P(a2) || (k_exact_zero_p(a2))) return a1; } - if (a2 == Qundef) { + if (UNDEF_P(a2)) { if (k_numeric_p(a1) && !f_real_p(a1)) return a1; /* should raise exception for consistency */ @@ -2133,7 +2133,7 @@ nucomp_convert(VALUE klass, VALUE a1, VALUE a2, int raise) int argc; VALUE argv2[2]; argv2[0] = a1; - if (a2 == Qundef) { + if (UNDEF_P(a2)) { argv2[1] = Qnil; argc = 1; } |