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

ruby-changes:74221

From: S-H-GAMELINKS <ko1@a...>
Date: Mon, 24 Oct 2022 17:25:19 +0900 (JST)
Subject: [ruby-changes:74221] 298221dfe5 (master): Reuse RBOOL macro in rb_ivar_defined function

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

From 298221dfe56c905800967ab7dbe4cf74cecdc531 Mon Sep 17 00:00:00 2001
From: S-H-GAMELINKS <gamelinks007@g...>
Date: Mon, 24 Oct 2022 16:31:07 +0900
Subject: Reuse RBOOL macro in rb_ivar_defined function

---
 variable.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/variable.c b/variable.c
index d41ea75214..5643edb3cc 100644
--- a/variable.c
+++ b/variable.c
@@ -1594,12 +1594,7 @@ rb_ivar_defined(VALUE obj, ID id) https://github.com/ruby/ruby/blob/trunk/variable.c#L1594
     switch (BUILTIN_TYPE(obj)) {
       case T_CLASS:
       case T_MODULE:
-        if (RCLASS_IV_TBL(obj) && lock_st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id)) {
-            return Qtrue;
-        }
-        else {
-            return Qfalse;
-        }
+        return RBOOL(RCLASS_IV_TBL(obj) && lock_st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id));
       default:
         return RBOOL(rb_shape_get_iv_index(rb_shape_get_shape(obj), id, &index));
     }
-- 
cgit v1.2.3


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

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