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

ruby-changes:65547

From: Aaron <ko1@a...>
Date: Thu, 18 Mar 2021 02:55:55 +0900 (JST)
Subject: [ruby-changes:65547] 04a814931a (master): return bool instead of VALUE

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

From 04a814931a1b1f421980f3d0d0451c60ecff8682 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Wed, 17 Mar 2021 09:10:42 -0700
Subject: return bool instead of VALUE

---
 vm_insnhelper.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index f343de0..23b3c51 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3969,7 +3969,7 @@ vm_once_clear(VALUE data) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3969
 
 /* defined insn */
 
-static VALUE
+static bool
 check_respond_to_missing(VALUE obj, VALUE v)
 {
     VALUE args[2];
@@ -3978,14 +3978,14 @@ check_respond_to_missing(VALUE obj, VALUE v) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3978
     args[0] = obj; args[1] = Qfalse;
     r = rb_check_funcall(v, idRespond_to_missing, 2, args);
     if (r != Qundef && RTEST(r)) {
-	return Qtrue;
+	return true;
     }
     else {
-	return Qfalse;
+	return false;
     }
 }
 
-static VALUE
+static bool
 vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE obj, VALUE v)
 {
     VALUE klass;
@@ -4028,7 +4028,7 @@ vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4028
 		    break;
 		}
 	      case METHOD_VISI_PUBLIC:
-                return Qtrue;
+                return true;
 		break;
 	      default:
 		rb_bug("vm_defined: unreachable: %u", (unsigned int)METHOD_ENTRY_VISI(me));
@@ -4041,7 +4041,7 @@ vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4041
       }
       case DEFINED_YIELD:
 	if (GET_BLOCK_HANDLER() != VM_BLOCK_HANDLER_NONE) {
-            return Qtrue;
+            return true;
 	}
 	break;
       case DEFINED_ZSUPER:
@@ -4065,7 +4065,7 @@ vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4065
 	break;
     }
 
-    return Qfalse;
+    return false;
 }
 
 static const VALUE *
-- 
cgit v1.1


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

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