[前][次][番号順一覧][スレッド一覧]

ruby-changes:72973

From: S-H-GAMELINKS <ko1@a...>
Date: Fri, 19 Aug 2022 09:47:59 +0900 (JST)
Subject: [ruby-changes:72973] f095361758 (master): Repalce to NIL_P macro

https://git.ruby-lang.org/ruby.git/commit/?id=f095361758

From f09536175853d883130c2e54a1d418b497890462 Mon Sep 17 00:00:00 2001
From: S-H-GAMELINKS <gamelinks007@g...>
Date: Wed, 29 Jun 2022 21:59:39 +0900
Subject: Repalce to NIL_P macro

---
 parse.y         | 2 +-
 variable.c      | 2 +-
 vm_insnhelper.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/parse.y b/parse.y
index d0f37a18cc..cdb7b4b93c 100644
--- a/parse.y
+++ b/parse.y
@@ -13612,7 +13612,7 @@ ripper_validate_object(VALUE self, VALUE x) https://github.com/ruby/ruby/blob/trunk/parse.y#L13612
 {
     if (x == Qfalse) return x;
     if (x == Qtrue) return x;
-    if (x == Qnil) return x;
+    if (NIL_P(x)) return x;
     if (x == Qundef)
 	rb_raise(rb_eArgError, "Qundef given");
     if (FIXNUM_P(x)) return x;
diff --git a/variable.c b/variable.c
index a3512adc99..056a1000b8 100644
--- a/variable.c
+++ b/variable.c
@@ -2605,7 +2605,7 @@ autoload_load_needed(VALUE _arguments) https://github.com/ruby/ruby/blob/trunk/variable.c#L2605
         return Qfalse;
     }
 
-    if (autoload_data->mutex == Qnil) {
+    if (NIL_P(autoload_data->mutex)) {
         autoload_data->mutex = rb_mutex_new();
         autoload_data->fork_gen = GET_VM()->fork_gen;
     }
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 1812f7ce71..837c71ffd5 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -4841,7 +4841,7 @@ vm_objtostring(const rb_iseq_t *iseq, VALUE recv, CALL_DATA cd) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4841
             // going to use this string for interpolation, it's fine to use the
             // frozen string.
             VALUE val = rb_mod_name(recv);
-            if (val == Qnil) {
+            if (NIL_P(val)) {
                 val = rb_mod_to_s(recv);
             }
             return val;
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]