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

ruby-changes:67915

From: S-H-GAMELINKS <ko1@a...>
Date: Sat, 11 Sep 2021 08:49:12 +0900 (JST)
Subject: [ruby-changes:67915] 56065f0686 (master): Using SYMBOL_P macro

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

From 56065f0686e6798fff2ee7319f0f03026f427c13 Mon Sep 17 00:00:00 2001
From: S-H-GAMELINKS <gamelinks007@g...>
Date: Thu, 2 Sep 2021 12:15:21 +0900
Subject: Using SYMBOL_P macro

---
 compile.c   | 4 ++--
 struct.c    | 2 +-
 transcode.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compile.c b/compile.c
index 2ee51f8..0569601 100644
--- a/compile.c
+++ b/compile.c
@@ -4103,7 +4103,7 @@ compile_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, https://github.com/ruby/ruby/blob/trunk/compile.c#L4103
             seen_nodes++;
 
 	    assert(nd_type(node) == NODE_LIST);
-            if (key_node && nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {
+            if (key_node && nd_type(key_node) == NODE_LIT && SYMBOL_P(key_node->nd_lit)) {
 		/* can be keywords */
 	    }
 	    else {
@@ -12406,7 +12406,7 @@ ibf_dump_object_object(struct ibf_dump *dump, VALUE obj) https://github.com/ruby/ruby/blob/trunk/compile.c#L12406
     current_offset = ibf_dump_pos(dump);
 
     if (SPECIAL_CONST_P(obj) &&
-        ! (RB_TYPE_P(obj, T_SYMBOL) ||
+        ! (SYMBOL_P(obj) ||
            RB_TYPE_P(obj, T_FLOAT))) {
         obj_header.special_const = TRUE;
         obj_header.frozen = TRUE;
diff --git a/struct.c b/struct.c
index 9207c62..e1c0145 100644
--- a/struct.c
+++ b/struct.c
@@ -1060,7 +1060,7 @@ rb_struct_pos(VALUE s, VALUE *name) https://github.com/ruby/ruby/blob/trunk/struct.c#L1060
     long i;
     VALUE idx = *name;
 
-    if (RB_TYPE_P(idx, T_SYMBOL)) {
+    if (SYMBOL_P(idx)) {
 	return struct_member_pos(s, idx);
     }
     else if (RB_TYPE_P(idx, T_STRING)) {
diff --git a/transcode.c b/transcode.c
index c61698e..bc98599 100644
--- a/transcode.c
+++ b/transcode.c
@@ -2464,7 +2464,7 @@ econv_opts(VALUE opt, int ecflags) https://github.com/ruby/ruby/blob/trunk/transcode.c#L2464
         else if (v==sym_attr) {
             ecflags |= ECONV_XML_ATTR_CONTENT_DECORATOR|ECONV_XML_ATTR_QUOTE_DECORATOR|ECONV_UNDEF_HEX_CHARREF;
         }
-        else if (RB_TYPE_P(v, T_SYMBOL)) {
+        else if (SYMBOL_P(v)) {
             rb_raise(rb_eArgError, "unexpected value for xml option: %"PRIsVALUE, rb_sym2str(v));
         }
         else {
-- 
cgit v1.1


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

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